Sujet : Re: "sed" question
De : geoff (at) *nospam* clare.See-My-Signature.invalid (Geoff Clare)
Groupes : comp.lang.awkDate : 12. Mar 2024, 14:47:09
Autres entêtes
Message-ID : <tv26ck-3qt.ln1@ID-313840.user.individual.net>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13
User-Agent : Pan/0.154 (Izium; 517acf4)
Mr. Man-wai Chang wrote:
Do Linux and Unix have a ONE AND ONLY ONE STANDARD regex library?
It seemed that tools and programming languages have their own
implementions, let alone different versions among them.
In the POSIX/UNIX standard the functions used for handling regular
expressions are regcomp() and regexec() (and regerror() and regfree()).
They are in the C library, not a separate "regex library".
They support different RE flavours via flags. The standard requires
that "basic regular expressions" (default) and "extended regular
expressions" (with REG_EXTENDED flag) are supported. Implementations
can support other flavours with non-standard flags.
POSIX requires that awk uses extended regular expressions (i.e. the
same as regcomp() with REG_EXTENDED).
-- Geoff Clare <netnews@gclare.org.uk>