Weird regex mode searching in normal search mode
-
I can get Notepad++ into a state where it searches for a regular expression even when the Search mode is set for Normal. I can’t seem to get a reliable set of reproductions steps for it, though, so I was wondering if some others might try their hand at it and test if they can see the problem.
I’m searching for
\r
as a literal – and yes, I have\
followed byr
in the text of my file. What Notepad++ is doing is matching on each end-of-line, and not on the literal text\r
.I thought it might be related to In selection searching, which I was doing at the time I first noticed it, and I also had the inspiration that it might be related to doing a regex search, then restarting N++, and then setting normal search mode before doing the very first search, but experimenting further with these features has not worked to reproduce the problem I’m seeing.
If I’m in this funky “mode” and I change only the search text between
\r
and.
, only the former causes this regex action in normal mode – searching for the.
only finds literal periods, not “any char”.Notepad++ 8.1.9.3
-
I should also add that I’m mainly using Find Next functionality when this happens, although I just tried Find All in Current Document and it does the same (bad) thing.
-
Not sure I can help, but …
I see 3 search modes: Normal, Extended and Regular expression.
If \r is matching with end-of-lines, then you could be in Extended mode which allows for some additional characters not in Normal mode (by using the \ prefix), but this is not Regex mode. -
Thanks for your thoughts but I thought I made it clear that I was in Normal mode when this was happening.
-
Could it be that you use “scripted” searches in between when this happens?
-
@ekopalypse said in Weird regex mode searching in normal search mode:
Could it be that you use “scripted” searches in between when this happens?
Sure I do. :-)
Considering this now, I don’t see how the two things (interactive N++ searches vs. scripted searches) could interfere…do you have any ideas on that? -
the SCI_SETSEARCHFLAGS might be the culprit.
But I haven’t done any tests, I must say.