Menu

#2490 Regexp to simulate DOTALL mode does not work

Bug
closed
nobody
None
5
2025-11-11
2025-11-10
No

This is on SciTE 5.5.8 on Windows 11 24H2 with find.replace.regexp.cpp11=1.

Regular expression first[\d\D]*second does not match the test string

first line
second line

I suppose it should work, since SciTE uses ECMAScript grammar (as per [1])? I tested it with [2], and it works. I want to use it as a workaround to simulate DOTALL mode.

[1] https://sourceforge.net/p/scintilla/code/ci/default/tree/src/Document.cxx#l3402
[2] https://regex101.com/r/DHihB3/1

Discussion

  • Neil Hodgson

    Neil Hodgson - 2025-11-10

    From the comment in MatchOnLines:

        // MSVC and libc++ have problems with ^ and $ matching line ends inside a range.
        // CRLF line ends are also a problem as ^ and $ only treat LF as a line end.
        // The std::regex::multiline option was added to C++17 to improve behaviour but
        // has not been implemented by compiler runtimes with MSVC always in multiline
        // mode and libc++ and libstdc++ always in single-line mode.
        // If multiline regex worked well then the line by line iteration could be removed
        // for the forwards case and replaced with the following:
    

    You can experiment with multi-line regular expressions by defining REGEX_MULTILINE when building.

     
    👍
    1
    • Georger Araujo

      Georger Araujo - 2025-11-10

      I understand. Please close the ticket.

       
    • Georger Araujo

      Georger Araujo - 2025-11-11

      It worked with w64devkit 2.4.0 [1], which ships gcc 15.2.0.

      [1] https://github.com/skeeto/w64devkit

       
  • Neil Hodgson

    Neil Hodgson - 2025-11-10
    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB