Regular expression syntax for “match nothing”?

This shouldn’t match anything:

re.compile('$^')

So if you replace regexp1, regexp2 and regexp3 with ‘$^’ it will be impossible to find a match. Unless you are using the multi line mode.


After some tests I found a better solution

re.compile('a^')

It is impossible to match and will fail earlier than the previous solution. You can replace a with any other character and it will always be impossible to match

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)