Do you know of a test suite which would permit someone to test
compliance?
As far as I know, the original code used in Tcl's regular expression
code was not written with compliance to any of the "standards" (most
of which are not really standards) as a goal. And in fact, Tcl's
regular expressions were the first (or nearly so) to handle unicode ...
Tcl surely does not conform to PCRE. Posix i don't know, might be, at
least the re_syntax man page mentions posix once or twice.
Michael
Standards are GREAT! And, there's soooooooo many to choose from!!
As I understand it, Posix supports three sorts of regular expressions,
'simple' regular expressions (deprecated), 'basic' regular expressions
and 'extended' regular expressions. Basic regular expressions are what
you see in 'sed' and 'grep', while extended regular expressions are
what you get with 'grep -E' or 'egrep'.
The Tcl commands that accept regular expressions can be made to use
Posix-compliant ones by beginning the regular expression with embedded
options. A regular expression that begins with the four characters
(?b) is interpreted as a Posix-style basic regular expression;
a regular expression that begins with (?e) is a Posix-style extended
regular expression. Tcl's default is to use 'advanced' regular
expressions, which are similar to the ones used in Perl and Python.
They are *not* identical; Tcl's are superior for Unicode handling;
Perl's arguably handle "mixed greediness" better, but I don't
claim to understand Perl's ill-documented rules for that case.
PCRE is a specific regular expression library written by
Philip Hazel. It is of note that Perl itself does not use the
PCRE library, and in fact the two are not fully compatible;
thus Perl's own regular expressions are not "Perl-compatible!"
Virtually all of the additional functionality of Tcl's
advanced regular expression syntax is added in
such a way that it would be either a syntax error (for example,
'(?:...)' or a nonsensical request (for example, '...*?') in
conventional ERE's, so few users ever need to request POSIX-
compatible RE's explicitly, but '(?e)' is there if you need it.
--
73 de ke9tv/2, Kevin