#30072
Patrick C
Participant

Hello David

Sorry, I should have read your initial question more carefully, as you did explain that To be strange , img \{\n works.

I just tested this with EmEditor Version 24.4.0.

When selecting Escape Sequence instead of Regular Expressions, both Find and Find in Files work with img {\n.

When selecting Regular Expressions (with the Boost.Regex engine) …
… and with Treat CR and LF Separately deactivated …
… and searching for img {\n:
● The regular find (not in files) works, regardless of CR+LF or LF line endings.
● Find in files will not find CR+LF, but it will find LF line endings.

After experimenting a bit …
When using Find in Files with Treat CR and LF Separately deactivated:
As soon as the Find term contains a { or a }, \n seems to exclusively find LF but not CR+LF. This even when { is followed by text before the \n.

Example:

Line 1 { abcd
Line 2 def { abc
Line 3

● Find in Files searching for abc\n works with both LF and CR+LF line endings.
● Find in Files searching for def { abc\n works only with LF line endings.
Adding a closing bracket as in

Line 1 { abcd
Line 2 def {a} abc
Line 3

won’t help either, i.e.
● Find in Files searching for def {a} abc\n works only with LF line endings.

What also won’t help is a complete regex, e.g. find ab{1}c\n.
……
Its as if { or } behave as a token to let \n match LF but no longer match CR+LF, even when Treat CR and LF Separately is disabled.

As to why this is: Good question.
I guess that this is for Yutaka to answer.

Cheers,
Patrick