Regex Tester

Test JavaScript regular expressions against sample text, highlight every match, inspect capture groups and character offsets, and preview replacement output while you type.

Regular expression flags

Test matches and replacements

Enter the pattern without surrounding slash characters, then paste realistic test text. The match list shows the matched value, its offset, and captured groups. In the replacement field you can use JavaScript replacement tokens such as $1 for the first capture group or $& for the full match.

This tester uses the regular expression engine built into your browser, so behavior follows JavaScript rather than PCRE, Python, Java, or .NET syntax. Large inputs and patterns with excessive backtracking can be slow even when they are valid.

Related tools: Text Find and Replace · String Escape