Re: Internal viewer regular expression search

Tim Stoodt via mc <[email protected]> Wed, 20 Nov 2024 14:36:27 -0600
Newsgroups gmane.comp.gnome.apps.mc.general
Message-ID <[email protected]>
Looks like it acts differently in mcedit. I know, not helpful.


On 11/20/24 8:39 AM, skejg via mc wrote:
>
> Hi!
>
>
> Let's say we have the following file:
>
> ---
>    A   A
>
>    B   A
>
> A
> ---
>
> Now, let's open it in the internal viewer and start a regular expression
> search for the following pattern: ^\s*A.
> At first, it will find the very first occurrence, 'beginning of the
> line, 4 spaces, A'. So far so good. But if we then press 'S-F7' or 'n'
> to find the next match, the cursor will move to the next space on the
> first match. I.e., it looks like at first it found '4 spaces and A',
> then '3 spaces and A', and so on. And then it will move to the second
> A on the very same first row. Then skips the third A (rightly so). And
> then jumps to the last A on the fifth row (again, rightly so).
>
> The problem is
>
>  - there's really no such match as ^\s\s\sA. Or any other matches on
>    the first row (as if it just ignores ^ further on if a match has
>    been found)
>  - And even if we drop ^, it still would be rather strange to find,
>    at first, the greediest match, and then continue searching inside
>    that greediest match for the less greedy ones.
>
> Is this behaviour intentional?
>
>
>
>

-- 
mc mailing list
[email protected]
https://lists.midnight-commander.org/mailman/listinfo/mc