Reputation: 58301
I want a regex with this rule: everything what not contains ?
I tried this but doesn't works:
^(?!\?)$
Upvotes: 1
Views: 159
Reputation: 41759
[^?]*
(zero or more not-?). You might need to escape the ? with a \ depending on your regex impementation. If your regex doesn't match agains the whole string by default, then
^[^?]*$
This will also match the empty string. If you don't want that, replace * with +
Upvotes: 2