Notepad3 icon indicating copy to clipboard operation
Notepad3 copied to clipboard

$ regex matching when it shouldn't, for cr+lf

Open np3fan opened this issue 1 year ago • 0 comments

A regex to find character X in the middle of a line, but not the start or end: ^.+X.+$

This matches the line thisXthat

but also matches the line XhelloX

It should not match the latter line.

As a second example, this regex: A.$ should match two characters however for text A AA AAA

all lines match. The problem seems to exist when using CR+LF but not when using LF. Enabling Show Line Endings for this example shows some of the problem.

np3fan avatar Feb 17 '24 01:02 np3fan