- LuzineDebug
- Tools
- Regex tester
Live regular expression tester
Test a regular expression live: highlighted matches, groups, replacement. Everything happens in your browser.
Cheat sheet
. any character (except newline without s)
\d \w \s digit, word character, whitespace
[abc] [^abc] one character in / not in the set
* + ? {2,5} repetitions (add ? for the lazy version)
^ $ \b start, end, word boundary
(…) (?:…) (?<nom>…) capturing, non-capturing, named group
(?=…) (?!…) (?<=…) (?<!…) lookahead / lookbehindFrequently asked questions
Which regex flavour is used?
JavaScript (ECMAScript), with named groups (?<name>…), lookbehind (?<=…) and the u flag for Unicode. It is very close to PCRE (PHP) and Python for everyday use.
Why does my regex freeze the page?
Some patterns such as (a+)+$ cause catastrophic backtracking. Here the test runs separately and stops after 2 seconds, with a warning.
Errors this tool helps solve
Other tools
Error finder
Paste an error message or a log: the tool recognises the error and opens the right fix.
JSON validator
Validate, format and minify JSON, with the exact line and column of the error.
JWT decoder
Decode a JWT: header, payload, readable expiry dates and whether the token has expired.
HTTP status codes
All the common HTTP codes (401, 403, 404, 419, 429, 500, 502…): meaning, causes and what to do.
Text diff
Compare two versions line by line: additions, deletions, invisible whitespace.