- or download this
/(.)*/s - or download this
'abcd' =~ /(?:(.)(.))*/s - or download this
'abcd' =~ /(?:(.){2})*/s - or download this
$1 eq 'a'
$2 eq 'b'
$3 eq 'c'
$4 eq 'd'
- or download this
'abcdx' =~ /(?:(.)(.))*(.)/s - 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.
- or download this
my @words;
'foo bar baz baz burk | gah' =~ /
(?{ local @_words })
...
(??{ quotemeta $_words[-1] })
(?{ @words = @_words })
/x;