Regex Cheatsheet - Regular Expression Quick Reference

Quick reference for regular expression patterns. Character classes, quantifiers, anchors, and common patterns.

Share
Back to Regex Cheatsheet

Named Capturing Group (?<name>abc)

Group

Named capturing group, referenced by name

Pattern

(?<name>abc)

Syntax

Explanation

Named groups improve readability. Access via match().groups.name in JS.

Examples

(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})

Name date components

Matches: 2024-01-15

(?<protocol>https?)://(?<domain>[^/]+)

Name URL parts

Matches: https://example.com

Related Tools

More Text Tools