Regex Tester
Write a regular expression and see matches highlighted live as you type, with capture groups and positions listed. Uses your browser's own JavaScript regex engine, so behaviour is exactly what your code will do.
ada@example.comat 8alan@test.orgat 27The flags
gglobal — find every match rather than stopping at the first.iignore case — match regardless of capitalisation.mmultiline — makes^and$match at each line start and end rather than only the whole string.sdotall — lets.match newline characters, which it otherwise does not.uunicode — enables proper handling of characters outside the basic plane, including emoji.
Patterns worth knowing
\ddigit ·\wword character ·\swhitespace — capitalise any of them to negate.+one or more ·*zero or more ·?optional ·{2,5}between two and five.^start ·$end ·\bword boundary.(...)capture group ·(?:...)group without capturing ·(?<name>...)named group.(?=...)lookahead ·(?<=...)lookbehind — assert without consuming characters.
Greedy versus lazy matching
This catches everyone. Quantifiers are greedy by default — they take as much as possible. Against <b>one</b> and <b>two</b>, the pattern <b>.*</b> matches the entire string, because .* grabs everything and only backtracks enough to find the final </b>. Adding ? makes it lazy: <b>.*?</b> stops at the first closing tag and returns two matches instead of one.
Do not parse HTML with regex
Regular expressions cannot correctly parse nested structures — HTML, XML, and JSON included — because they have no concept of arbitrary nesting depth. A pattern that works on your test input will break on real markup with nested tags, attributes containing angle brackets, or comments. Use a real parser. For simply removing tags from text you control, the HTML stripper is the pragmatic option.