Re: Problems with searching using regular expressions
Yury Dubinsky <[email protected]> Tue, 12 Mar 2024 18:52:08 -0700 (PDT)
| Newsgroups | gmane.editors.scite.general |
|---|---|
| Message-ID | <[email protected]> |
Hi, Neil, Thanks for the explanation! I am trying to identify high-level tasks to improve the current behaviour. >>>about handling empty matches Once again: current Scite doesn't find empty matches using ^ $ ^$ . I did some additional test on the behaviour of many editors and utilities and compared them to Scite before and after 4.05. All of editors, plus old Scite (< 4.05), could correctly find ^ $ ^$ . (Including Geany, which also uses Scintilla's Reg. Ex engine.) (Searching for ^$ is important to identify empty lines. The search for ^ and $ allows us to quickly prefix and suffix all lines in the text. We could do this also using backslash expressions. But, Reg. Ex is simpler.) Here we have another confusing issue. The Replace empty matches using ^ , $ and ^$ works fine! I tested in 5.4.1. Thus, we could replace ^ , $ and ^$ , but we couldn't find them. The old Scite's behaviour seems more consistent with this. I would consider restoring the old behaviour, but you mentioned that *"earlier versions of SciTE tried something like this and it caused worse problems."* Could you remember these problems? >>>a flag for not matching the empty string at start Do you suggest adding similar flags to the engine (RESearch.cxx) and adding flags to Scite to control the behaviour? >> problem with "Bookmark All I'll try to suggest a solution for better handling. Thanks Yury On Tuesday, March 5, 2024 at 2:05:20 AM UTC-5 Neil Hodgson wrote: > Yury: > > 3. Affects any version of Scite, problem with "Bookmark All" using one of > the expressions above. Scite does not bookmark all the required lines. See > attached screenshots 2 and 3. (My intention was to bookmark all empty lines > using ^$ in the attached file.) The behaviour is strange. For example, when > we scroll to the bottom of an attached file and call "bookmark all" with > ^$, the top lines will not be marked. The number of lines with bookmarks > depends on the scroll position when calling “Bookmark All”. (It is possible > to bookmark all the lines. We need to scroll through the file and use the > command again and again. But this requires a lot of attention.) > > > This is caused by the lack of progress with an empty result at the end of > a batch of lines. It loops around infinitely retrying the end of the batch > until a 250ms timer goes off and it gives up. Might be fixable with some > better handling of the end condition but it's messy as an empty result is > valid for this search and you don't want a match missing at the end of the > batch. > > 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/a0418417-9ad4-454f-8ff0-a1fd34561267n%40googlegroups.com.