Re: Problems with searching using regular expressions

"'Neil Hodgson' via scite-interest" <[email protected]> Fri, 1 Mar 2024 08:35:45 +1100
Newsgroups gmane.editors.scite.general
Message-ID <[email protected]>
Hi Yury,
>     • " Find Next" does not work with ^$ , ^.*$ , $ , ^ after the first found occurrence.

This isn't about regular expressions matching, its about handling empty matches where SciTE's behaviour is poor.

When there is a simple caret (empty selection) at the start of a non-empty line, then searching for ^. should find and select the first character. So SciTE asks the regular expression code to search from the end of the selection (in this case the caret) to the end of file and returns start-of-line extending for 1 character.

If you try the same thing for ^$ when at the start of an empty line, the regular expression code returns start-of-line extending for 0 characters which is also a valid response. It can't treat an empty match as wrong since that is precisely what you are seeking.

Code sometimes tries to break out of this issue by advancing the start of search by 1 which can lead to more problems. I think earlier versions of SciTE tried something like this and it caused worse problems.

Neil

-- 
You received this message because you are subscribed to the Google Groups "scite-interest" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/scite-interest/299515F6-9BAF-4F0E-9F79-B140C2BBD6D8%40me.com.