in reply to Posix regexes in Perl

Hi again

I skimmed thru https://www.postgresql.org/docs/14/functions-matching.html and found some features which were new to me.

E.g. I've never heard of metacharacters \m or \M (?) I tested them and Perl will only see the escaped characters, i.e. literal m and M .

> It would be ideal if Perl 5.6 were a superset of Posix.

I'm afraid Postgres has another incompatible superset of Posix

Further searching revealed that PG is apparently using the TCL RE-engine and

> There are a number of important differences between Tcl Advanced Regular Expressions and Perl-style regular expressions. Tcl uses \m, \M, \y and \Y for word boundaries. Perl and most other modern regex flavors use \b and \B. In Tcl, these last two match a backspace and a backslash, respectively.

see here for more:

good luck with that using Perl tools. :|

I think you will be better off using something from the TCL toolchain.

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

Replies are listed 'Best First'.
Re^2: Posix regexes in Perl (Tcl Advanced Regular Expressions)
by The Perlman (Scribe) on Oct 08, 2021 at 01:03 UTC
    "I think you will be better off using something from the TCL toolchain"

    Patching YAPE::Regex::Explain could be easier, it's a rather compact module.

    - Ron