Table of Contents

Regular expression - Negation

About

Regular expression is a language that does not have a NOT operator but it has some negative construct

Construct

Negative Class

^ will negate the class, ie capture until not this characters

Example:

[^abc]1
[^a-z]1
[^p]*

Negative Look

See Regexp - Look-around group (Assertion) - ( Lookahead | Lookbehind )

Example:

(?=\?)(.*)