--- title: "Regex tester — free, runs in your browser" description: "Test a regular expression against sample text, with matches and capture groups shown. Free, no sign-up, and nothing you enter leaves your browser." url: https://atoneplace.net/tools/regex-tester/ site: "At One Place" --- # Regex tester Test a regular expression against sample text, with matches and capture groups shown. ## How it works Tests a JavaScript regular expression against sample text, listing every match with its position and capture groups. Flags matter more than people expect. Without the global flag only the first match is returned; without multiline, the anchors ^ and $ match the start and end of the whole string rather than of each line. Most confusion about a regex that "does not work" comes down to one of those two. A caution worth stating: a badly-formed regex can take exponential time on certain inputs, a failure known as catastrophic backtracking. Nested quantifiers like (a+)+ are the classic trigger. It matters because a regex run on user input is then a denial-of-service vector, and this is a genuine class of production incident rather than a theoretical concern. This uses your browser’s own engine, so the behaviour matches JavaScript exactly. Other languages differ — lookbehind, named groups and Unicode handling all vary between PCRE, Python and Go. > This tool runs entirely in your browser. Nothing you enter is sent to a server, logged or stored, and the page keeps working with the network disconnected. ## Common questions ### Why does my regex only match once? The global flag is missing. Without it, matching stops at the first result. ### What is catastrophic backtracking? A pattern whose matching time grows exponentially on some inputs, usually from nested quantifiers like (a+)+. Run on user input it becomes a denial-of-service vector. ### Will this regex work in Python? Not necessarily. This uses the JavaScript engine; lookbehind, named groups and Unicode handling all differ between engines. ## Related pages - [Word and character counter](https://atoneplace.net/tools/word-counter/) - [Typing speed test](https://atoneplace.net/tools/typing-speed-test/) - [Remove duplicate lines](https://atoneplace.net/tools/remove-duplicate-lines/) - [Sort lines alphabetically](https://atoneplace.net/tools/sort-lines/) - [JSON formatter and validator](https://atoneplace.net/tools/json-formatter/) - [Text compare](https://atoneplace.net/tools/text-diff/) - [Case converter](https://atoneplace.net/tools/case-converter/) - [Remove empty lines](https://atoneplace.net/tools/remove-empty-lines/) - [Find and replace](https://atoneplace.net/tools/find-and-replace/) - [Readability checker](https://atoneplace.net/tools/readability-checker/) ## Sources - Calculated on this page — At One Place (/about/)