Help for this page

Select Code to Download


  1. or download this
    $foo =~ /abc([\w]+)xyz/;
    $bar = $1;
    
  2. or download this
    ($bar) = /abc([\w]+)xyz/;
    
  3. or download this
    If the /g option is not used, m// in a list
    context returns a list consisting of the
    subexpressions matched by the parentheses
    ...
    in the pattern, the return value is the list (1)
    for success.  With or without parentheses, an
    empty list is returned upon failure.