Understand what a pattern matches
Test a small positive and negative example in the browser’s JavaScript regex dialect before transforming data.
Common utilities for regex and string processing: tester with multiline and named-group support, replacer, meta-character escape, and HTML entity encode/decode.
Filter by Focus
A regex describes matches; replacement syntax describes the resulting text; escaping makes a literal safe in one specific syntax. Applying an HTML encoder to a regex pattern does not solve regex escaping.
Test a small positive and negative example in the browser’s JavaScript regex dialect before transforming data.
Check capture-group references and the g flag. A capture group is not an extra match.
Escape text for use as a regex pattern. Do not reuse that result as HTML, SQL or a shell command.
Text: ab ab Pattern: (a)(b) Replacement: $2$1 No g flag: ba ab (1 match) With g: ba ba (2 matches)
Enter the pattern without slash delimiters. Compare both the output and match count. If matching literal a.b, escape the dot so it cannot match a different character.
Browser JavaScript regex is not PCRE. Complex backtracking patterns may stall the page; use small samples and simplify nested ambiguous quantifiers first.
Encode five special characters or decode HTML entities one layer
Regex & String
Test JavaScript regex matches and inspect indices
Regex & String
Find and replace text using regular expressions
Regex & String
Escape and unescape regex special chars
Regex & String