in reply to How to consolidate regex's?

If you want to be very strict about the pattern of the string (including the comma).
perl -e '$a = "1,234,340 views";print "$1\n" if($a =~ /^((?:\d{1,3})?( +?:,\d{3})*) views$/);'
I think using "^" will speed up things a bit (although a few nanoseconds won't make much difference) when compared to similar regex without "^".