Help for this page

Select Code to Download


  1. or download this
    perl -e '
      $f = "\$foo \$(bar) \n";
      $f =~ s/\$ (?: (\w+) | \((\w+)\) )/<$^N>/xg;
      print $f;'
    
  2. or download this
    perl -e '
      my $f = "\$foo \$(bar)";
    ...
        | \((\w+) (?{ $val = $^N }) \)  # or match 2 and store
        )                               # close outer
      }{<$val>}xg; print "$f\n"'