Regex Tester

Test JavaScript regular expressions and inspect matches, captures and positions.

Processed locally in your browser. Your input is not uploaded.

How to use Regex Tester

Enter a JavaScript pattern without slash delimiters. Choose global, case-insensitive, multiline, dotAll and Unicode flags. Results are shown as a safe plain-text list.

Details and limits

Match positions are zero-based UTF-16 offsets with an exclusive end. Results stop at 1,000 matches. A worker time limit reduces the risk from slow patterns; it does not guarantee that every expensive pattern can be evaluated. Text is limited to 100,000 characters.

Practical example

Enter the pattern without enclosing slashes and choose flags separately. The global flag finds successive matches rather than only the first.

Use [0-9]+ with global matching on A12 B345. It finds 12 at [1, 3) and 345 at [5, 8); end positions are exclusive.

Frequently asked questions

Why does a pattern find only the first match?

Without the global flag, matching stops after the first result. Enable global matching when you want all non-overlapping occurrences.

What is the difference between multiline and dotAll?

Multiline changes how ^ and $ match line boundaries. dotAll lets a dot match line breaks; enabling one does not enable the other.

Can I paste a pattern copied from another programming language?

Only if it is compatible with JavaScript regular expressions. Features and escaping rules from other engines may need adjustment.