my $num_views = -1; my $val = "23,452,789 views"; if ( $val =~ /(\b[\d,]+\b) views/ ) { ( $num_views = $1 ) =~ tr/,//d; print "# Matched number of views [$num_views].\n"; } else { print "# Error.\n"; }
In reply to Re: How to consolidate regex's?
by jwkrahn
in thread How to consolidate regex's?
by BruceDB
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |