Developer tool
Regex Tester: JavaScript Matches With Time Limits
Test JavaScript regular expressions locally and inspect match text and positions without running patterns on the main UI thread.
How to use Regex Tester
- Enter a pattern without surrounding slash delimiters and choose valid JavaScript flags.
- Paste test text, then run. Global matching is enabled so every match is reported.
- Review match positions, copy or download results, or cancel processing.
Example
The pattern cat with flags gi finds Cat and cat. The zero-width pattern (?=.) on ab reports positions 0 and 1.
Limits and troubleshooting
JavaScript syntax, not PCRE or Python regex. Indices use UTF-16 code units. Up to 200,000 input characters, a 2,000-character pattern and 10,000 matches; the worker stops slow patterns after 1.5 seconds.
Continue your workflow
Find and Replace Text: Whole Words and Regex · JSON Formatter and Validator · Word Counter Online
Questions and answers
Why did my pattern time out?
Some expressions backtrack excessively. Simplify nested quantifiers or shorten the text; a timeout is not a syntax error.
Why are Unicode positions unexpected?
JavaScript indices count UTF-16 code units, so some characters occupy two units. Use the appropriate Unicode flags for matching semantics.