Regular Expression Quick Reference Guide
Regular expressions (Regex) are specific text-matching patterns constructed with special wildcards, qualifiers, and groups:
| Syntax | Definition | Example |
|---|---|---|
| . | Matches any single character except newline. | c.t → cat, cot |
| \d | Matches any numerical digit (0-9). | \d\d → 42, 99 |
| \w | Matches alphanumeric characters and underscore. | \w+ → hello |
| + | Quantifier matching 1 or more occurrences. | a+ → a, aa, aaa |
| * | Quantifier matching 0 or more occurrences. | ab* → a, ab, abb |
| (...) | Creates a capture group to extract specific subsets. | (\d+) → extracts number |
Frequently Asked Questions
By default, regular expressions without the g (global) flag stop searching as soon as they discover their first match in the string. Checking the global option causes the engine to scan the entire text from start to finish, yielding all occurrences.
JavaScript regular expressions support lookbehind assertions ((?<=...) and (?<!...)) in modern browsers, but old browser layouts or non-compliant engines might flag them as invalid syntax. Ensure your browser is fully updated.
Yes. All regex matches are computed dynamically inside your browser thread using your local V8/JavaScript engine. No text contents are uploaded or processed externally.