Developer & Data tool

Regular Expression Tester

See what a JavaScript regular expression matches and how its replacement changes text.

The match list displays at most 100 entries. Replacement scope follows your g flag.

Test a JavaScript regular expressionInspect matches, groups, and replacement output.
LOCAL
Replaced textToday is 2026/08/28.

#1 2026-08-28 → [2026, 08, 28] @ 9

Read matches, groups and positions together

  • Separate pattern from flags

    Enter the pattern without surrounding slashes, and put flags in their own field. Results update as you edit the test text.

  • Inspect what was matched

    Read captured groups and the position after @ alongside each match. Compare with the original to catch unintended extra characters or missing matches.

  • Try the replacement too

    Use references such as $1 to reuse groups. Add g to replace every match and read the resulting text to check the final format.

Change date separators

Start with
Pattern (\d{4})-(\d{2})-(\d{2}) / g / text 2026-10-02 / replacement $1/$2/$3
Check the result
2026/10/02; groups 2026, 10, 02; match position @ 0

The parentheses capture year, month and day, and the replacement joins them in the same order.