in reply to How to consolidate regex's?
If you don't mind accepting 23,,4,5,2789 too, this combo will work:
if ($val =~ /([\d,]*) views/) { $num_views= $1; $num_views=~s/,//g;
UPDATE: Thanks to GrandFather the 'fi' (which only the NSA knows about) was changed to 'if'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to consolidate regex's?
by ikegami (Patriarch) on Feb 05, 2010 at 07:30 UTC |