notepad4 icon indicating copy to clipboard operation
notepad4 copied to clipboard

Regex: special case `^` and `$` require special treatment

Open lifenjoiner opened this issue 1 year ago • 3 comments

a8471540

  1. Continuous search after found, requires one extra move;
  2. Select All does not work yet.

lifenjoiner avatar Aug 17 '24 00:08 lifenjoiner

^ and $ seems is working, what's the test case? image

zufuliu avatar Aug 17 '24 22:08 zufuliu

Yes, your example works, and the special cases are:

  1. only ^ or $, to quickly select the beginning or ending of lines, especially the ending;
  2. ^ and $, to select empty lines.

"Find All" works, other actions don't.

lifenjoiner avatar Aug 17 '24 23:08 lifenjoiner

empty matches are skipped: https://github.com/zufuliu/notepad4/blob/10605475bd597620f0d124a747f36702524e03fa/src/Edit.cpp#L5480-L5489

https://github.com/zufuliu/notepad4/blob/10605475bd597620f0d124a747f36702524e03fa/src/Edit.cpp#L5590-L5595

zufuliu avatar Aug 18 '24 01:08 zufuliu