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'
In reply to Re: How to consolidate regex's?
by jethro
in thread How to consolidate regex's?
by BruceDB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |