Sort of a two part question:
NOTE: I am not referring to matching the empty string (that would be easy, just "").
Without multi-line mode, the end doesn't usually tend to appear before the beginning:
$.^
Or more simply, again without multi-line mode:
$.
With lookarounds, you can do all kinds of contradictory stuff:
(?=a)(?=b)
This forces a character to be two different things at once, which is of course impossible.
You could use contradictory lookbehinds, for example
\w(?<!\w)
Here \w will match any word character and the lookbehind (?<!\w) will make sure that the last character was not a word.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With