Re: alternation option end of string
Ray Andrews <[email protected]> Sun, 3 May 2026 06:56:23 -0700
| Newsgroups | gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user |
|---|---|
| Message-ID | <[email protected]> |
On 2026-05-02 21:33, Alexis wrote:
>
>
> There are different flavours of regex - POSIX BREs, POSIX EREs, PCREs,
> etc. - but i can't recall encountering a flavour where `$` doesn't
> have the semantics described by Bart. (i'd be interested to know if
> there is one.)
It might not actually be the '$' just some mechanism for matching a
string that must end after some substring. Of course the ${ % } method
does just that, but if the test is from the beginning of the string it's
more involved. But Roman's method is so satisfactory that maybe it's a
thin point. It would seem to require some new special char that it
seems we don't have and that would bloat the syntax space. Besides,
Roman's method is more self-explaining anyway.