rizonesoft / Notepad3

Notepad like text editor based on the Scintilla source code. Notepad3 based on code from Notepad2 and MiniPath on code from metapath. Download Notepad3:
https://www.rizonesoft.com/downloads/notepad3/
Other
5.01k stars 333 forks source link

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

Closed np3fan closed 7 months ago

np3fan commented 7 months ago

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.

RaiKoHoff commented 7 months ago

There seems to be a difference between RegEx-Engines: Some engines treat the CR (Carriage-Return character) not as line-break and the dot (.) can match this character (Visual Studio 2022 does so). Some other engines treat the CR (or CR``LF combi ?) as the line-break and the dot (.) does not match the CR (VS Code does so). So, I am not sure, what should be the correct behavior - besides my expectations.

RaiKoHoff commented 7 months ago

We changed it (PR #5116), preferring VSCode behavior

hpwamr commented 7 months ago

Hello @np3fan ,

Feel free to test the "BETA/RC PortableApps", version "Notepad3Portable_6.24.227.1_rc2.paf" or newer, see in issue #1129.

"Notepad3Portable BETA/RC PortableApps" version can be used with or without ".7z" extension.

Also, feel free to test the "BETA/RC Setup", version "Notepad3_6.24.227.1_rc2_Setup" or newer, see the 2nd list in issue #1129.

Comments and suggestions are welcome... 😃