View Single Post
Old 01-31-2022, 03:42 AM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Slightly better would be:

Code:
(\d{0,3}[,]?\d{1,3} [Ww]ords)
That should get any number up to 6 digits with or without the comma. But, it would miss the first digit in 1000000.

If I hadn't see your solution, I think I would have suggested:

Code:
([\d,]+ [Ww]ords)
Which would pickup ", words". So, slightly safer is:

Code:
([\d,]{2,} [Ww]ords\b)
davidfor is offline   Reply With Quote