#1822 Search strings longer than 90 characters fail to match

Bug
closed-fixed
5
2016-04-26
2016-03-25
No

I was trying to find loglines that indicated a particular event in my application. The first 65 characters in the log line are basically boilerplate text and date and time. Once the search string is longer than 90 characters the search always fails. I am attempting to do a search and replace to turn the following log lines into xml
Original

<30>Mar 24 04:28:58 SITENAME ServiceName: .892 WebService.Method::Updating data for product 123 at location 345 with quantity 4.
<30>Mar 24 04:29:18 SITENAME ServiceName: .921 WebService.Method::Updating data for product 234 at location 45 with quantity 154.
<30>Mar 24 04:30:00 SITENAME ServiceName: .013 WebService.Method::Updating data for product 1025 at location 12345 with quantity 41.
<30>Mar 24 04:31:12 SITENAME ServiceName: .125 WebService.Method::Updating data for product 12 at location 42345 with quantity 24.
<30>Mar 24 04:31:13 SITENAME ServiceName: .242 WebService.Method::Updating data for product 3 at location 45 with quantity 6.
and turn that into
<product>123</product><location>345</location><qty>4</qty>
<product>234</product><location>45</location><qty>154</qty>
<product>1025</product><location>12345</location><qty>41</qty>
My search string that works is

<\d>Mar \d \d:\d:\d SITENAME ServiceName: .\d WebService.Method::Updating data for p

but as soon as I add even one more character

<\d>Mar \d \d:\d:\d SITENAME ServiceName: .\d WebService.Method::Updating data for pr

it fails to find a match.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2016-03-25
    • labels: --> scintilla, search
    • status: open --> open-accepted
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson

    Neil Hodgson - 2016-03-25

    This will work if the search is made case-sensitive. With case-insensitive regular expression searches, each literal character is compiled into a 33-byte RE bitmap instruction and that overflows the 2K compilation buffer.

    The performance cost of increasing the size of the compilation buffer is unclear but it is probably reasonable to increase it to 4K.

    If you are developing your own application with Scintilla (as opposed to using the SciTE application) with a recent compiler, then you could turn on the C++11 regex engine which will not have this problem by defining CXX11_REGEX when building and including SCFIND_CXX11REGEX in search flags.

     
  • Neil Hodgson

    Neil Hodgson - 2016-03-29
    • status: open-accepted --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2016-03-29

    Size doubling committed as [177d44].

     

    Related

    Commit: [177d44]

  • Neil Hodgson

    Neil Hodgson - 2016-04-26
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks