What regex flavour does this tool use?+
JavaScript's built-in RegExp engine. This is compatible with most modern languages, though some advanced features (like possessive quantifiers) are JS-specific.
What do the flags g, i, m, s, u, d mean?+
g = global (find all matches, not just first), i = case-insensitive, m = multiline (^ and $ match line starts/ends), s = dotAll (. matches newlines), u = Unicode mode, d = generate match indices.
How do I test for an exact string match?+
Use ^ and $ anchors: ^your exact string$. Without anchors, the regex will match your string anywhere in the text.
How do I match an email address with regex?+
A simple pattern: [a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}. For production use, HTML's built-in email validation (type='email') or a library is more reliable.
What is the difference between a lookahead and a lookbehind in regex?+
A lookahead (?=...) checks what follows the current position without consuming characters. A lookbehind (?<=...) checks what precedes the current position. Negative versions (?!...) and (?<!...) assert the opposite. Both are zero-width assertions - they match a position, not characters.
What is the difference between greedy and lazy quantifiers?+
Greedy quantifiers (*, +, ?) match as many characters as possible. Lazy quantifiers (*?, +?, ??) match as few as possible. On the string 'a1b2c3', the greedy pattern \d+ matches all digits in sequence; a lazy variant stops at the first digit match.
What are some common regex patterns I should know?+
Email: [\w.+-]+@[\w-]+\.[\w.]+. URL: https?://[\S]+. Phone (US): \(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}. IP address: \d{1,3}(\.\d{1,3}){3}. Postcode (UK): [A-Z]{1,2}\d[A-Z\d]?\s?\d[A-Z]{2}.
How does regex work differently in JavaScript versus Python?+
JavaScript regex is built into the language - patterns use literal syntax (/pattern/flags) or RegExp objects. Python uses the re module with raw strings (r'pattern'). Key differences: Python supports named groups as (?P<name>...) and lookbehinds are fixed-width only in Python's re module. JavaScript added lookbehinds in ES2018.
Can complex regex patterns hurt performance?+
Yes. Catastrophic backtracking occurs when a pattern with nested quantifiers can match the same characters in exponentially many ways on a non-matching input. For example (a+)+ on a long non-matching string. Use possessive quantifiers or atomic groups where available, and test performance with long inputs.