Sujet : Re: Command Languages Versus Programming Languages
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 22. Nov 2024, 12:47:16
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vhpr06$15kuj$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 21.11.2024 23:05, Lawrence D'Oliveiro wrote:
On Thu, 21 Nov 2024 08:15:41 -0000 (UTC), Muttley wrote:
On Wed, 20 Nov 2024 21:43:41 -0000 (UTC)
Lawrence D'Oliveiro <ldo@nz.invalid> boring babbled:
[...]
>
That’s what “^” and “$” are for.
>
Yes, but people forget about those (literal) edge cases.
But *only* _literally_ "edge cases". Rather they're simple
and basics of regexp parsers since their beginning.
Those of us who are accustomed to using regexes do not.
It's one of the first things that regexp newbies learn,
I'd say.
Another handy one is “\b” for word boundaries.
I prefer \< and \> (that are quite commonly used) for such
structural things, also \( and \) for allowing references
to matched parts. And I prefer the \alpha regexp pattern
extension forms for things like \d \D \w \W \s \S . (But
that's not only a matter of taste but also a question of
what any regexp parser actually supports.)
Janis