Regex Tester
Test regular expressions with live match highlighting, flag toggles, and match position list.
How to use this tool
- 1Enter your regex pattern in the pattern field (between the / delimiters).
- 2Toggle the g, i, m, s flag buttons to set regex flags.
- 3Paste your test string in the 'Test string' textarea.
- 4Matches are highlighted in yellow and listed below with their positions.
About Regex Tester
Writing a regular expression and not knowing if it matches correctly is a common frustration. This tester shows live match highlighting as you type the pattern: matched substrings are highlighted in yellow in the test string panel. A match list below shows each match's index position and matched text. Four flag toggle buttons (g, i, m, s) let you switch global, case-insensitive, multiline, and dotAll modes on and off. The pattern is entered in a styled input with / delimiters and a flags field, matching the syntax you'd write in JavaScript code. If the pattern is invalid, the error message from the RegExp constructor is shown in red. The global flag is always applied for the match list; toggling g controls whether the highlighting replaces all matches or just the first. Developers writing validation patterns, data engineers building extraction regexes, and anyone learning regex syntax are the primary users.