Help for this page

Select Code to Download


  1. or download this
      /(.)*/s
  2. or download this
      'abcd' =~ /(?:(.)(.))*/s
  3. or download this
      'abcd' =~ /(?:(.){2})*/s
  4. or download this
      $1 eq 'a'
      $2 eq 'b'
      $3 eq 'c'
      $4 eq 'd'
    
  5. or download this
      'abcdx' =~ /(?:(.)(.))*(.)/s
  6. or download this
      $_ = 'foo bar baz burk | gah';
      my @words;
      /(?:(\w+)\s+(?{push @words => $1}))*/; # Not backtracking safe! See 
    +below.
      # Submatches are in @words now.
    
  7. or download this
      my @words;
      'foo bar baz baz burk | gah' =~ /
        (?{ local @_words })
    ...
        (??{ quotemeta $_words[-1] })
        (?{ @words = @_words })
      /x;