Some Perl Special Variables Some Regular Expression Special Variables 22 of 28 : [PREV] [NEXT]

$digit

  • Contains the text matched by the corresponding set of parentheses in the last pattern matched.
  $_ = "AlphaBetaGamma";
  /^(Alpha)(.*)(Gamma)$/;
  print "$1 then $2 then $3\n";
  # prints "Alpha then Beta then Gamma";

© 2004 Barbie barbie@missbarbell.co.uk Home http://birmingham.pm.org/