Neil Hodgson wrote:
Aggro:
The feature request is few years old, but I was not able to find and
replace line changes with Scite so I assume this isn't yet fixed in
Scintilla? ( I searched for \n and used regular expression flag and got
no results. ).
Yes, this has not been fixed in Scintilla.
I noticed that currently the search seems to work by searching line by
line, instead of whole buffer from start to end. Is there a good reason
for this, or did I misunderstand the code?
The regex code is very simple and was chosen based on licensing
considerations rather than features.
That, and perhaps the fact that the code is rather small.
IIRC, the RESearch::Execute
method can only search a single line and the calling code in
Document::FindText works around that.
Perhaps my memory is too blurred, but IIRC, the first time I used RE in
SciTE (thus, in Scintilla), I searched for something like "void .*)" to
look for a given function signature. At the time, I didn't knew much
about regular expressions and greedy search...
And I ended with a selection starting at the first function and ending
near the end of the file, on the last closing parenthesis found.
So:
1) In the beginning, searches were multilines, it may after complains
like mine ("it doesn't work intuitively!") that Neil implemented the
more useful (in most cases) line-per-line search.
A least, that's what I recall. And the RE code has support for \r and \n
expressions, which are not used because FindText doesn't provide EOL to
RESearch.
2) If multi-lines RE searches are possibles, this should be optional, or
one should add the possibility of non-greedy searches (.*?) or
something: somehow equivalent to [^)]* or [^\n\r)]*) which may be non
trivial...
Bottom line is, if I would
like to add support for multiline searches, is the task perhaps too big
for a person who is not familiar with Scintilla code (but knows C++) or
is there some internal thing or general problem that is not allowing
people to fix it?
It is easy to overlook a case and cause hangs in searching code so
any changes will need to be simple and thoroughly tested.
I now regard including regular expression support in Scintilla as a
mistake and encourage projects to implement their own version using an
established RE library.
Well, better something crude than nothing... At first, I knew next to
nothing to RE, but I because more and more addict to them... (Despite
the unreadable, prehistoric syntax.)
--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest