Skip to content
MyDailyTool

Regex Tester

Test JavaScript regular expressions live with instant match highlighting. Supports all JS regex flags (g, i, m, s, u) and shows match groups, indices, and global matches.

2 match(es)
  • @12: alice@example.com
    Groups: $1=alice, $2=example.com
  • @33: bob@example.org
    Groups: $1=bob, $2=example.org

How to use the regex tester

Enter a regular expression and flags, then test against any input. Each match shows its index and capture groups.

Formula & explanation

JavaScript regex syntax (PCRE-like, but not identical). Common flags: g (global), i (case-insensitive), m (multi-line), s (dotall).

Examples

Pattern: \d{3}-\d{4} matches "555-1234". Pattern with capture: (\w+)@(\w+\.\w+) extracts user and domain.

Frequently asked questions

What flags can I use?
JavaScript supports g (global — find all matches), i (case-insensitive), m (multiline — ^ and $ match line boundaries), s (dotall — dot matches newlines), and u (Unicode mode).
Why does my regex match nothing?
Common causes: forgetting to escape special characters like . + * ? ( ) [ ] { } ^ $ | \ — prepend a backslash to match them literally.
How do I extract a specific part of a match?
Wrap the part you want in parentheses to create a capture group. The tool displays each group's value alongside the full match.
Is JavaScript regex the same as PCRE?
Mostly, but not identical. JavaScript lacks some PCRE features (lookbehind support improved in ES2018, no possessive quantifiers or atomic groups). Code tested here may need small adjustments for Python/PHP/Perl.

Related developer tools tools

Related reading