For example, my org string is:
CCC=123
CCC=DDDDD
CCC=EE
CCC=123
CCC=FFFF
I want everything that does not equal to “CCC=123” to be changed to “CCC=AAA”
So the result is:
CCC=123
CCC=AAA
CCC=AAA
CCC=123
CCC=AAA
How to do it in regex?
If I want everything that is equal to “CCC=123” to be changed to “CCC=AAA”, it is easy to implement:
(AAA[ \t]*=)(123)
You can use a negative lookahead:
output:
These are zero-width, non capturing, which is why you have to then add the
.{3}to capture the non-matching characters to be replaced.