§ 9.1Flags
| Flag | Effect |
|---|---|
g | Find all matches, not just the first |
i | Case-insensitive |
m | ^ and $ match at each line, not just the whole text |
s | . also matches line breaks |
u | Unicode mode: \u{1F600} and \p{L} work, emoji count as one character |
y | Sticky: match only at lastIndex |
§ 9.2Engine differences to watch
This tester uses JavaScript’s engine. Most syntax is shared with PCRE (PHP), Python and Java, but not all of it:
- Named groups are
(?<name>…)in JavaScript; Python also accepts(?P<name>…). - JavaScript has no possessive quantifiers (
a++) or atomic groups. - Lookbehind
(?<=…)works in all current browsers.
§ 9.3Catastrophic backtracking
Patterns like (a+)+$ can take exponential time on a string that almost matches, freezing a page or a server (a “ReDoS”). Avoid nested quantifiers over the same characters, and anchor patterns where you can.
§ 9.QQuestions
Do I type the slashes around the pattern?
No. Type only the pattern, and put flags in the Flags box.
Why does my pattern from Python not work?
A few features differ between engines — see § 9.2.
§ 9.RReferences
Last reviewed 2026-10-14.