Regular Expression Tester
Test browser JavaScript regex matches, captures and an optional replacement preview.
Supported behavior
- Test browser JavaScript regex matches, captures and an optional replacement preview.
- Runs in an isolated worker terminated after 500 ms, with 2,000 pattern characters, 200,000 text/replacement characters and 1,000 matches maximum. No PCRE, lookbehind portability guarantee or code execution. Empty replacement means no preview, not deletion. Indices are UTF-16 offsets. Input limit: 200,000 characters per text input; regex and diff have additional limits described above.
How to use the Regular Expression Tester
- Enter the pattern without slash delimiters, sample text and optional replacement; toggle g, i, m, s or u.
- Review the result or error before copying. Shared output panels offer Copy; there is no file upload or download workflow.
- Tool input is processed locally without a tool API request. This does not establish site-wide analytics or logging policy.
Examples
Worked behavior
Pattern (?<id>\d+) against Order 123 returns 123 at UTF-16 index 6; replacement #$1 gives Order #123.
Limits and common mistakes
Runs in an isolated worker terminated after 500 ms, with 2,000 pattern characters, 200,000 text/replacement characters and 1,000 matches maximum. No PCRE, lookbehind portability guarantee or code execution. Empty replacement means no preview, not deletion. Indices are UTF-16 offsets. Input limit: 200,000 characters per text input; regex and diff have additional limits described above.
Frequently asked questions
Why can a valid pattern time out?
Backtracking can be expensive. Reduce text or simplify nested quantifiers; results depend on the browser JavaScript engine. Worker support is required.
Sources & methodology
More developer & data tools
Text Diff Checker
Compare two text blocks and identify line changes.
Open tool →Character Counter
Count characters, words, whitespace, sentences, lines, bytes and more with a live character limit.
Open tool →Word Counter
Count words, characters, unique words, repeated terms and reading or speaking time instantly.
Open tool →Find & Replace Tool
Find and replace plain text or regular-expression matches.
Open tool →Unix Timestamp Converter
Convert Unix epoch seconds or milliseconds to readable dates and back.
Open tool →HEX RGB HSL Color Converter
Convert 3- or 6-digit HEX input to RGB and rounded HSL.
Open tool →