Regex Cheatsheet - Regular Expression Quick Reference

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

Share
Back to Regex Cheatsheet

Negative Lookahead (?!abc)

Assertion

Matches position NOT followed by specified expression

Pattern

(?!abc)

Syntax

Explanation

Negative lookahead excludes matches followed by a specific pattern.

Examples

\d{3}(?!-)

Match 3 digits not followed by hyphen

Matches: 123, 456

\b(?!un)\w+\b

Match words not starting with "un"

Matches: happy, kind

Related Tools

More Text Tools