http://qs1969.pair.com?node_id=561315


in reply to regex for multiple capture within boundary

@nums = $x =~ m/(\d+)/g;
UPD: I just did not understand the OP correctly :)

Replies are listed 'Best First'.
Re^2: regex for multiple capture within boundary
by swkronenfeld (Hermit) on Jul 14, 2006 at 21:38 UTC
    This is pulling out all the digits. The OP is just asking for the "digits between the spaces".
    my $x = "a1aa11 b2bb22bbb222 c3cc33"; my @nums = $x =~ /\d+/g; print join(" ", @nums) . "\n"; Output: 1 11 2 22 222 3 33
    Ikegami's answer is pulling out the numbers between the spaces.