HippoEDIT forum

General Category => Bug reports => Topic started by: epfax on September 06, 2017, 04:31:29 PM

Title: REGEX anchors "^", "\A", and "\`" do not always work correct
Post by: epfax on September 06, 2017, 04:31:29 PM
I wanted to select the first n characters in the next some lines so I tried by REGEX:
[attachimg=1]

Example:
I put the cursor at the start of the file, and click Find next:
[attachimg=2]
OK

Then I click one more time Find next. My regular expression should select the first 7 characters of the second line. What it did was:
[attachimg=3]
not OK

I played with it and found out that if I set Scope from "Document" to "Open Documents", then it works the way it was expected to! And more, when I select "Mark Search Results in Text" and click  Find All, it also works right, no matter what Scope is set to:
[attachimg=4]

Kind regards
Eckart
Title: Re: REGEX anchors "^", "\A", and "\`" do not always work correct
Post by: epfax on September 06, 2017, 04:39:22 PM
Yes, I almost forgot to mention: I observed the same strange thing with the regular expressions or anchors "\A", and "\`" (match at the start of a buffer only) accordingly.
Title: Re: REGEX anchors "^", "\A", and "\`" do not always work correct
Post by: alex on September 08, 2017, 11:15:18 AM
Hi Eckart,

yes, reproduced. Thanks for the bug report, I will fix it in the new beta.
The issue is probably, that search starts in the second time, not from the beginning of the line, but from your cursor position, and logic recognize it as a buffer, line start.

BR, Alex.