Test a regular expression against your text with live match highlighting
Type a regular expression and some test text, and this tool highlights every match live, counts them, and lists any capture groups. Add flags like g, i, or m in the small box. If your pattern is invalid, you'll see exactly why.
A regular expression (regex) is a small pattern language for describing text. Instead of searching for one fixed string, you describe a shape — "three digits, a dash, then four digits" — and the engine finds every piece of text that fits. A few building blocks cover most needs:
\d a digit, \w a word character, \s whitespace, . any character.* zero or more, + one or more, ? optional, {2,4} a count range.[abc] a set of characters, (…) a capture group, | "or".^ start and $ end of the line/string.Flags change how matching works: g finds all matches (not just the first), i is case-insensitive, m makes ^/$ match each line, and s lets . match newlines.
g flag).? makes the u optional.g = global (all matches), i = ignore case, m = multiline (^/$ per line), s = dotall (. matches newlines), u = unicode, y = sticky. This tester uses g internally so it can highlight every match.
By default quantifiers are greedy — .* grabs as much as possible. Adding ? makes them lazy — .*? grabs as little as possible. This matters a lot when matching between delimiters.
Common causes: a special character used literally without escaping (e.g. . or ( need a backslash), the wrong flags (missing i for case), or anchors ^/$ that don't fit your text. The status line shows syntax errors.
No — matching runs entirely in your browser with JavaScript's native regex engine. Nothing is uploaded.