Help for this page

Select Code to Download


  1. or download this
    $str =~ s/(^|[^\%](?:\%\%)*)\%
              (\{)?                  # Match and capture 1 or 0 braces
              ([_a-zA-Z]\w*)
              (?(2)\})               # If there's anything in $2, match en
    +ding brace
              /"$1".$env->{$3}/gex;  # $3 now instead of $2 here
    
  2. or download this
    (?(condition)yes-pattern|no-pattern)
    (?(condition)yes-pattern)
    ...
    
    matches a chunk of non-parentheses, possibly included
    in parentheses themselves.