#9605
Deipotent
Participant

After thinking about this again, I re-looked at the regex in my linked post for finding duplicate lines, and realised that there appears to a bug in EmEditor’s regex parser.

My suggestion for ignoring r already appears to be implemented. Let me give some examples to explain:

1) Even if EmEditor didn’t ignore r, the following regex should work as the part, “r?”, is saying match zero or one occurrences of r. So it should match whether there is a r or not. But it doesn’t.

^(.*)(r?n1)+$

2) However, if you remove the ‘?’, so the regex becomes as follows, it works, and matches duplicate lines:

^(.*)(rn1)+$

3) It also works if you have the original regex, but replace “r” with “(r)”:

^(.*)((r)?n1)+$

So, the bug appears to be that EmEditor seems to have a problem applying ‘?’, when it follows a r. It already seems to just remove the “r”, so the original regex ends up being turned into

^(.*)(?n1)+$

which doesn’t work.