🌐 EN

🔣 Regex Tester

Test a JavaScript regular expression against sample text.

Common Patterns

Inputs and checks

  • Enter a JavaScript regex pattern without surrounding / characters.
  • Paste test text and choose flags g, i, m, s, u, or y; g starts enabled.
  • Press Test or a common-pattern button; changing the fields clears the previous test rather than running a new one.
  • Pattern and text each have a limit of 2,097,152 code units; testing has a 2-second deadline.

Reading the result

  • Match count and highlights show text found; capture groups appear separately when the pattern has groups.
  • Without g, only the first match is counted. At most 10,000 matches are processed.
  • A preset checks text pattern, not whether an email or date is real; this is JavaScript regex, not PCRE or Python syntax.

Examples

Find two occurrences of cat

Input
Pattern: (cat); text: cat dog cat; flags: g
Result
2 matches; both cat words highlighted; group $1 = cat for each match
How to check it
The global flag finds cat at the start and after dog; parentheses capture cat each time.

Find the first hello ignoring case

Input
Pattern: hello; text: HELLO hello; flags: i only
Result
1 match; HELLO highlighted; no capture groups
How to check it
The i flag ignores case, but without g the search stops at the first HELLO.

Frequently asked questions

Why do I get one match when text repeats?
Enable g to search for all occurrences.
Does editing the sample rerun the test?
No. Press Test again.
Can I replace matched text here?
No. The tool highlights matches and shows captures but has no replacement output.