Failing RE search for \n, \x10, \r, \x13. (?)

23 views
Skip to first unread message

MvGulik

unread,
May 8, 2021, 6:02:57 PMMay 8
to scite-interest
Long time local issue. :-(

Anyone might know why my local scite is incapable of finding "\n" or "\x10" or "\r" or "\13".
(searched character is available in the searched text)

It it finding "\t" or "\x09".

Scite: Version 4.3.0 compiled for GTK 3.24.14 (default available scite package for ...)
OS: Linux Mint 20 Cinnamon.

Neil Hodgson

unread,
May 8, 2021, 6:13:47 PMMay 8
to scite-i...@googlegroups.com
MvGulik:

> Anyone might know why my local scite is incapable of finding "\n" or "\x10" or "\r" or "\13".
> (searched character is available in the searched text)

This is a limitation of the implementation:

( https://www.scintilla.org/SciTERegEx.html )
Note that \r and \n are never matched because in Scintilla, regular expression searches are made line per line (stripped of end-of-line chars).

Neil

MvGulik

unread,
May 9, 2021, 8:05:26 AMMay 9
to scite-interest
Roger.
So no way around it in a regular scite version. :-((

Neil Hodgson

unread,
May 9, 2021, 7:15:14 PMMay 9
to scite-interest
MvGulik:

> So no way around it in a regular scite version. :-((

No. The built-in RE code is fairly primitive and won’t match ‘^’ or ‘$’ for line start / end unless the search is broken down into a series of per-line searches. ‘^’ and ‘$’ anchored searches are very common compared to searches that include ‘\n’.

Common std::regex implementations (turned on with find.replace.regexp.cpp11=1) have similar limitations. There’s an '#ifdef REGEX_MULTILINE’ in scintilla/src/Document.cxx that you can experiment with.

Neil
Reply all
Reply to author
Forward
0 new messages