MDN’s refreshed JavaScript regular expression reference gives developers a focused entry point for each regex feature, presenting syntax, semantics, examples, and browser support in a single, searchable page.
Overall Page Layout
The top‑level reference page groups the 18 feature pages under logical categories, making it easy to jump directly to the topic you need.
- Sidebar navigation mirrors the category tree for fast access.
- Each feature page starts with a concise definition followed by a syntax table.
- Compatibility tables list support per browser version.
- Example blocks demonstrate real‑world usage.
- Links to related MDN articles appear at the bottom.
Feature Pages: Syntax & Semantics
Every regex construct—such as quantifiers, character classes, or look‑arounds—receives its own page that explains the grammar and edge cases.
- Clear syntax diagram generated from the ECMA‑262 specification.
- Explanation of semantic nuances, e.g., greedy vs. lazy quantifiers.
- Common pitfalls highlighted with warnings.
- Sample code snippets that can be copied directly.
- Reference to the regular expression concept for background.
Browser Compatibility Information
Granular compatibility tables let you see exactly which versions implement a given feature, reducing guesswork for polyfills.
- Data sourced from MDN compatibility tables.
- Separate rows for desktop and mobile browsers.
- Notes on partial support or required flags.
- Links to Can I Use for quick cross‑check.
- Visual indicator for deprecated or removed features.
Practical Examples & Patterns
Each page includes a handful of curated examples that illustrate typical use cases, from date parsing to Unicode script detection.
- Capturing groups example for ISO dates (YYYY‑MM‑DD).
- Named capturing groups to improve readability of log‑parsing regexes.
- Unicode property escapes for script detection (e.g.,
/\p{Script=Latin}/u). - Character class range example for hexadecimal validation.
- Link to a broader JavaScript performance guide: Accelerate JavaScript Development with Bun.
Contribution Workflow
New pages were created after a community discussion on GitHub, followed by iterative pull requests and review cycles.
- Initial feedback collected via a GitHub discussion.
- Drafted scaffold added by Joshua Chen.
- Multiple review rounds ensured accuracy and completeness.
- Changes merged into the MDN content repository and published.
- For developers interested in set operations, see the upcoming v‑flag proposal illustrated in New JavaScript Set Methods.