in reply to Regex question is this one of those look (ahead|behind)s ?

In contrast to Re: Regex question is this one of those look (ahead|behind)s ?, produced using PPIx::Regexp::xplain because YAPE::Regex::Explain is dead; file ppixregexplain.pl needs _desc.pl, the explanation

         
    # my $regstr = join '', ; # The regular expression (PPI::Token::Regexp::Substitute): ; #
# s/^(?<!abc)def/$1xyz/
#
# matches as follows:
#r: PPIx::Regexp / PPI::Token::Regexp::Substitute
#r= "s/^(?<!abc)def/\$1xyz/"
#
          "s",
      # address=/1/C0 ; xRe::Token::Structure ; Represent structural elements.
#"s",
# ------------------------------------------------------------------
               
       # address=/1/C1 ; xRe::Structure::Regexp ; Represent the top-level regular expression
# ------
            "/",
       # address=/1/C1/S0 ; xRe::Token::Delimiter ; Represent the delimiters of the regular expression
#"/",
# ------------------------------------------------------------------
                "^",
         # # address=/1/C1/C0 ; xRe::Token::Assertion ; simple zero-width assertion (zero-length, between pos()itions)
# match the beginning of the string
#"^",
# ------------------------------------------------------------------
                     
          # # address=/1/C1/C1 ; xRe::Structure::Assertion ; a parenthesized assertion
# (the grouptype below explains which one)
# ------------
                  "(",
          # address=/1/C1/C1/S0 ; xRe::Token::Structure ; Represent structural elements.
#"(",
# ------------------------------------------------------------------
                    "?<!",
           # # address=/1/C1/C1/T0 ; xRe::Token::GroupType::Assertion ; a look ahead or look behind assertion
# (?<!pattern)
# L<perlre/(?<!pattern)>
# A zero-width negative look-behind assertion.
# For example C</(?<!bar)foo/> matches any occurrence of "foo" that does not follow "bar".
# Works only for fixed-width look-behind.
#"?<!",
# ------------------------------------------------------------------
                      "a",
            # # address=/1/C1/C1/C0 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 97 ) ) alias \N{U+0061} alias \141 alias LATIN SMALL LETTER A alias a
#"a",
# ------------------------------------------------------------------
                      "b",
            # # address=/1/C1/C1/C1 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 98 ) ) alias \N{U+0062} alias \142 alias LATIN SMALL LETTER B alias b
#"b",
# ------------------------------------------------------------------
                      "c",
            # # address=/1/C1/C1/C2 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 99 ) ) alias \N{U+0063} alias \143 alias LATIN SMALL LETTER C alias c
#"c",
# ------------------------------------------------------------------
                  ")",
          # address=/1/C1/C1/F0 ; xRe::Token::Structure ; Represent structural elements.
#")",
# ------------------------------------------------------------------
                "d",
         # # address=/1/C1/C2 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 100 ) ) alias \N{U+0064} alias \144 alias LATIN SMALL LETTER D alias d
#"d",
# ------------------------------------------------------------------
                "e",
         # # address=/1/C1/C3 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 101 ) ) alias \N{U+0065} alias \145 alias LATIN SMALL LETTER E alias e
#"e",
# ------------------------------------------------------------------
                "f",
         # # address=/1/C1/C4 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 102 ) ) alias \N{U+0066} alias \146 alias LATIN SMALL LETTER F alias f
#"f",
# ------------------------------------------------------------------
            "/",
       # address=/1/C1/F0 ; xRe::Token::Delimiter ; Represent the delimiters of the regular expression
#"/",
# ------------------------------------------------------------------
               
       # address=/1/C2 ; xRe::Structure::Replacement ; Represent the replacement in s///
# ------
                "\$1",
         # # address=/1/C2/C0 ; xRe::Token::Interpolation ; Represent an interpolation in the PPIx::Regexp package.
# It is a variable! subject to \F\l\u\L\U\Q\E
# L<perlre/\F\l\u\L\U\Q\E>
# It is a variable! whose contents are used as a REPLACEMENT string (unless it starts with \ in which case its not a variable anymore)
#"\$1",
# ------------------------------------------------------------------
                "x",
         # # address=/1/C2/C1 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 120 ) ) alias \N{U+0078} alias \170 alias LATIN SMALL LETTER X alias x
#"x",
# ------------------------------------------------------------------
                "y",
         # # address=/1/C2/C2 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 121 ) ) alias \N{U+0079} alias \171 alias LATIN SMALL LETTER Y alias y
#"y",
# ------------------------------------------------------------------
                "z",
         # # address=/1/C2/C3 ; xRe::Token::Literal ; a literal character
# ordinal= ord( chr( 122 ) ) alias \N{U+007A} alias \172 alias LATIN SMALL LETTER Z alias z
#"z",
# ------------------------------------------------------------------
            "/",
       # address=/1/C2/F0 ; xRe::Token::Delimiter ; Represent the delimiters of the regular expression
#"/",
# ------------------------------------------------------------------
          "",
      # address=/1/C3 ; xRe::Token::Modifier ; Represent 1)embedded pattern-match modifiers or 2)(trailing) modifiers for operators match, substitution, regexp constructor
#"",
# ------------------------------------------------------------------
         
    ;;;;;;;;;;

Also interesting (but tad more pita to install) is wxPPIxregexplain.pl

  • Comment on Re: Regex question is this one of those look (ahead|behind)s ?