Regular expression is a language that does not have a NOT operator but it has some negative construct
^ will negate the class, ie capture until not this characters
Example:
[^abc]1
[^a-z]1
[^p]*
See Regexp - Look-around group (Assertion) - ( Lookahead | Lookbehind )
Example:
(?=\?)(.*)