No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I want a single regex that grabs all the number characters between the spaces Extreme regexing? I cannot resist such a question. This ought to do it: @nums = $x =~ /(?:^\S*\s+|\G)[^\s\d]*(\d+)/g;However, if it does not absolutely have to be a single regex, I suspect the maintainer will prefer one of ikegami's solutions. :-) Update: I've been out-extremed! Not perhaps by the first of ikegami's latter solutions, which after all is straight-forward, and probably as maintainable as mine, but certainly by the second. It took me three attempts just to read it: My eyes glazed over twice! ... what's with the local *nums; though? Yet another update: Ah. Considerate of you. :-)
print "Just another Perl ${\(trickster and hacker)},"
In reply to Re: regex for multiple capture within boundary
by Sidhekin
|
|