Does there exist a regular expression that matches no strings? If so, what is it?
To be precise, I\'m looking for a regular expression r
such that the follo
If your regex engine supports lookahead (which Python's does):
(?!)
Otherwise something like this would work too:
^\b$
A word break can't occur by itself!
Or,
$a^
The end of the string can't match at the start of the string unless the string is empty, and we prevent it from being empty by requiring that we match at least one character.
Then again, ^
/$
/\b
are really just lookarounds in disguise.