Neil Hodgson | 24 Jul 02:41 2013

C++11 regex

    Attached is an updated patch to use C++11's regular expression implementation within Scintilla. Unlike
previous versions it performs backwards regex searches. The limited state of regex implementations in
C++ support libraries means this isn't being committed now. The libstdc++ library used with g++ has an
empty regex implementation, so this will not work at all with g++. 

   Other implementations have problems with '^' and '$'. The runtime for Visual C++ only recognises \n line
ends for start/end line, not \r\n or \r. libc++ used by Clang on OS X doesn't match '^' or '$' inside a search
range, only at the ends. To get around these issues, the patch performs line by line searches, just like
Scintilla's current limited regex. This means that regex searches will not match over line ends. It may be
possible to add another flag to regex to choose between line by line and whole range searches but the
results of whole range searches are still going to be platform dependent.

   I still want to add C++11 regex to Scintilla at some point but, for now, applications that want good regex
support should implement this in the application code, possibly using calls like SCI_GETRANGEPOINTER
for fast access to the text inside Scintilla.



You received this message because you are subscribed to the Google Groups "scintilla-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scintilla-interest+unsubscribe <at>
To post to this group, send email to scintilla-interest <at>
Visit this group at
For more options, visit

Attachment (regex.patch): application/octet-stream, 19 KiB