#1839 Replace beginning of lines with ^ regexp failed on some lines

Bug
closed-fixed
5
2016-09-05
2016-06-17
No

Hi,
In SciTE 3.6.5 on Linux Fedora platform, if I replace the beginning of all lines of a file with the regexp ^ symbol in the replace dialog, then lines after empty lines are ignored and not replaced.

e.g.: I write a file containing three lines:
aaa

bbb

then in the replace dialog window, I type ^ in the "Find what" field and CCC in the "Replace with" field and I select "Regular expression".
The result of the "Replacement all" operation is:
CCCaa
CCC
bb

The third line (following an empty line) isn't replaced and is "bb" instead of "CCCbb"

It's a minor problem.
Have a good holiday!

Discussion

  • Neil Hodgson

    Neil Hodgson - 2016-08-11
    • labels: regexp --> regexp, scite
    • assigned_to: Neil Hodgson
     
  • Neil Hodgson

    Neil Hodgson - 2016-08-11

    Committed fix as [5e7672].

    Handling of replacements where the match is empty are tricky as the matching has to always move forward to avoid infinite loops. There were two pieces of code that forced forward movement which caused the next line to be skipped. This has been changed to one but its possible that this will cause further problems.

    There are similar problems with replacing /$/XX/ which I won't be trying to fix since this is in complex code connecting the search code with the regex implementation.

     

    Related

    Commit: [5e7672]

  • Neil Hodgson

    Neil Hodgson - 2016-08-12
    • status: open --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2016-09-05
    • 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