The regex /abc$/
will match an abc
that does appear at the end of the line. How do I do the inverse?
I want to match abc
that isn't at the end of a line.
Furthermore, I'm going to be using the regex to replace strings, so I want to capture only abc
, not anything after the string, so /abc.+$/
doesn't work, because it would replace not only abc
but anything after abc
too.
What is the correct regex to use?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…