I have not been able to find a proper regex to match any string not ending with some condition. For example, I don't want to match anything ending with an a
.
This matches
b
ab
1
This doesn't match
a
ba
I know the regex should be ending with $
to mark the end, though I don't know what should preceed it.
Edit: The original question doesn't seem to be a legit example for my case. So: how to handle more than one character? Say anything not ending with ab
?
I've been able to fix this, using this thread:
.*(?:(?!ab).).$
Though the downside with this is, it doesn't match a string of one character.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…