Regex Tester
Test JavaScript patterns and inspect matches, offsets, and capture groups.
Runs locally with a 1.5-second timeout. Enter a pattern without surrounding slashes.
Flags: g all matches · i ignore case · m multiline · s dot matches newlines · u Unicode · y sticky. Offsets use UTF-16 code units.
About Regex Tester
The regex tester runs a JavaScript regular expression against your sample text and lists every match as JSON. Enter the pattern without surrounding slashes and type flags in the Flags box. The accepted flags are d, g, i, m, s, u, v and y; anything else is rejected, and some newer flags depend on your browser. The engine is the built-in JavaScript RegExp, so lookbehind, named groups and Unicode property escapes follow your browser rather than PCRE or Python rules. Each match reports its index, matched text, an array of numbered capture groups with null for any group that did not take part, and a namedGroups object. Offsets count UTF-16 code units, so an emoji occupies two positions. Without g or y, only the first match is returned. Empty matches are handled, and the search steps forward so it never loops forever. The default pattern (?<word>\w+) with the g flag on the text Hello regex returns two matches, at index 0 and index 6. Evaluation happens in a separate worker that is terminated after 1.5 seconds, which stops catastrophic backtracking from freezing the tab. Limits are 2,000 characters of pattern, 100,000 characters of text, and 500 matches or 100,000 characters of match data, after which output is marked truncated.
How to use Regex Tester
- Type your pattern into the Pattern box, without slashes.
- Enter flags such as g, i or m in the Flags box.
- Paste the sample into Test text and press Test regex.
- Read the match list, or press Cancel if a slow pattern is still running.