Interactive searchable reference for regular expression syntax, with one-click copy for every pattern.
Character Classes
Anchors
Quantifiers
Groups & Lookaround
Flags
Common Patterns
Frequently Asked Questions
A regular expression (regex) is a sequence of characters that defines a search pattern. It is used for pattern matching within strings — common uses include validation, search and replace, and text extraction. Most programming languages support regex natively.
Greedy quantifiers (*, +, ?) match as much text as possible, while lazy quantifiers (*?, +?, ??) match as little as possible. For example, given '<b>bold</b>', the pattern '<.*>' greedily matches the entire string, while '<.*?>' lazily matches just '<b>'.
Lookaheads (?=...) and lookbehinds (?<=...) are zero-width assertions that check for a pattern without consuming characters. Positive variants match when the pattern exists; negative variants (?!...) and (?<!...) match when it doesn't. They are useful for complex conditional matching.
Use the 'i' flag after your regex pattern, e.g., /hello/i matches 'Hello', 'HELLO', and 'hello'. In most programming languages, you can also set this flag in the regex constructor or compile options.