in reply to Re^2: newbie to regex: all matches
in thread newbie to regex: all matches

use warnings; use strict; my $str = do {local $/; <DATA>}; my @matches = $str =~ /(\w+):(.*)/g; print "@matches\n"; __DATA__ 1: one 2: two 3: three

Prints:

1 one 2 two 3 three

DWIM is Perl's answer to Gödel