in reply to regex grouping
Update: oh, you want each grouping to start with a \w, and end with an equal sign and the number following it.$_ = '1 2=3 4=5'; for my $up_to_3 (/(?:\W*\w+){1,3}/g) { print $up_to_3, "\n"; }
$_ = '1 2 3 2 6=7 2=4 j=384923 34 43 j 3=6'; for my $foo (/(?:\w[^=]*=\w+)/g) { print $foo, "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex grouping
by jfroebe (Parson) on Nov 02, 2005 at 19:12 UTC |