Page 1 of 1

Searching for \n

Posted: Fri Feb 24, 2017 2:49 am
by gwgs
Found a little bug while working today.

Scenario:
Open file to edit that has the text \n in it some where.
Find \n in file with 'Use regular expressions' un-ticked.
Find will now find every newline in the file, not the text '\n'

Not a biggie, but not the results I was expecting when searching for \n

Zeus 3.98h on Windows 10 Enterprise 64-bit



Grant

Re: Searching for \n

Posted: Fri Feb 24, 2017 4:07 am
by jussij
By design, the default search (i.e. even with regular expression turned off) recognises the \n mnemonic.

The same is true for the '\t' tab character.

So this means if you want to search for the \ character you need to delimit that character.

In other words to search for:

Code: Select all

\n
will require the following search string:

Code: Select all

\\n
Cheers Jussi

Re: Searching for \n

Posted: Sun Feb 26, 2017 9:26 pm
by gwgs
Thanks for that Jussi.


Grant