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, 20:20:06
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vhqlh7$1a8kb$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 22.11.2024 19:19, Kaz Kylheku wrote:
On 2024-11-22, Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
On 21.11.2024 20:12, Kaz Kylheku wrote:
[...]
>
In the wild, you see regexes being used for all sorts of stupid stuff,
>
No one can prevent folks using features for stupid things. Yes.
But the thing is that "modern" regular expressions (Perl regex and its
progeny) have features that are designed to exclusively cater to these
folks.
Which ones are you specifically thinking of?
Since I'm not using Perl I don't know all the Perl RE details. Besides
the basic REs I'm aware of the abbreviations (like '\d') (that I like),
then extensions of Chomsky-3 (like back-references) (that I also like
to have in cases I need them; but one must know what we buy with them),
then the minimum-match (as opposed to matching the longest substring)
(which I think is useful to simplify some types of expressions), and
there was another one that evades my memories, something like context
dependent patterns (also useful), and wasn't there also some syntax to
match subexpression-hierarchies (useful as well) (similar like in GNU
Awk's gensub() (probably in a more primitive variant there), and also
existing in Kornshell patterns that also supports some more from above
[Perl-]features, like the abbreviations).
Janis