Regex Tester

Write your regular expression (regex) pattern, choose the flags, and see matches and capture groups on your test text instantly.

Runs 100% in your browser — your pattern and test text are never sent to a server.
/ /g
0 match(es)

Try This Next

Finished here? These might be your next step.

Frequently Asked Questions

Regex (regular expression) is a compact syntax that lets you search for and find a specific pattern within text. It's used, for example, to find all email addresses in a text, extract phone numbers from a document, enforce that a form field only accepts data in a specific format (validation), or bulk-replace certain words in a text. It shows up with the same logic in almost every programming language and in many text editors (find/replace).

  • g (global): Doesn't stop at the first match — it finds every match in the text. If turned off, only the first match is shown — this mirrors real JavaScript regex behavior.
  • i (case-insensitive): Ignores case differences (Ali and ALI are treated the same).
  • m (multiline): Makes ^ and $ match not just the start/end of the whole text, but the start/end of every line in a multi-line text.
  • s (dotAll): Normally . doesn't match a newline (\n); with this flag on, it matches every character including newlines.

Some complex/nested patterns (a situation known as "catastrophic backtracking") can temporarily freeze the browser tab on long texts. This only affects your own browser tab — it doesn't affect anyone else, and since no data is ever sent to a server, it poses no risk server-side either. If the tab freezes, simply close and reopen the page; try simplifying your pattern (especially nested repetition groups like (x+)+).

Last updated: