Regex Tester
Write a regular expression, paste some test text, and every match highlights live as you type — with capture groups listed and flags you can toggle. Nothing is evaluated on a server; the expression runs against your text in your own browser.
Runs in your browser — nothing is uploaded
Questions
- Which regex flavour is this?
- JavaScript's, since it runs in your browser using the native RegExp engine. It is close to PCRE for everyday patterns but differs in places — lookbehind support varies by browser, and there are no possessive quantifiers or atomic groups.
- What do the flags do?
- g finds every match rather than stopping at the first; i ignores case; m makes ^ and $ match at each line rather than only at the ends of the string; s lets . match a newline. g and i are the two you will use constantly.
- Why is my pattern extremely slow?
- Probably catastrophic backtracking — nested quantifiers such as (a+)+ against a long non-matching string can take exponential time. Make the inner pattern more specific, or anchor the expression. This is a real denial-of-service vector when a regex runs on user input.
- Should I parse HTML with a regex?
- No. HTML is not a regular language, so no expression can handle nesting correctly, and the near-misses fail on exactly the input you did not test. Use DOMParser in the browser or a real parser on the server.