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


In reply to Re: Regex question is this one of those look (ahead|behind)s ? by Anonymous Monk
in thread Regex question is this one of those look (ahead|behind)s ? by misterperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.