Skip to content
Utilerio

Regex Tester

Write and test regular expressions against sample text with live highlights.

//g

Highlighted Matches

The result will appear here.

Was this tool useful?

About this tool

Regular expressions are patterns that describe sets of strings. They are used to search, validate and transform text in virtually every programming language. Testing a regex interactively against sample input is the fastest way to develop and debug them.

This tester uses the JavaScript regex engine (ECMA-262). The supported syntax is identical to what you would use in a browser or Node.js application, so what works here will work in your code.

How to use it

  1. Type your regular expression in the Pattern field.
  2. Enable flags as needed: g (find all matches), i (ignore case), m (^ and $ match line boundaries), s (dot matches newlines).
  3. Paste or type your test text. Matches are highlighted immediately.
  4. The match list below shows each match, its position and any capturing groups.

Examples

Match all email addresses

Email: user@example.com or admin@site.org
Pattern: [a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}
Flags: g
Matches: user@example.com, admin@site.org

Common problems

The pattern shows a red error but looks correct.
Check that special characters like (, ), [, ], {, } are properly escaped with a backslash when you mean a literal character, not a regex operator.

Frequently asked questions