Loading...
Test and debug regular expressions with real-time match highlighting.
Regex flavors differ. Python supports lookbehind with variable length, atomic groups, and \A/\Z anchors. JavaScript lacks these but added lookbehind (ES2018) and named groups. Always test in the target language's flavor.
When a regex has nested quantifiers (e.g., (a+)+), the engine may explore exponentially many paths on non-matching input. This can freeze your application. Fix by using possessive quantifiers, atomic groups, or rewriting the pattern.
Add the 'i' flag: /pattern/i in JavaScript, re.IGNORECASE in Python, (?i) inline modifier in most flavors. This affects only ASCII letters by default; Unicode case folding requires additional flags.
Greedy (*, +, ?) matches as much as possible, then backtracks. Lazy (*?, +?, ??) matches as little as possible, then expands. For `<.*>` on `<a><b>`, greedy matches `<a><b>`, lazy matches `<a>`.
By default, `.` doesn't match newlines and `^/$` match string start/end. Use the `s` flag (dotall) to make `.` match newlines, and the `m` flag (multiline) to make `^/$` match line start/end.