I want to detect strings that have a user's age in them, for example :
"I'm 24 years old" "J'ai 25 ans"
So essentially it would look for :
- starts zero or more characters (any)
- followed by two digits - match Arabic (0,1,2,etc) and Hindi (٠,١,٢, etc) numerals
- followed by one of the 'age' words (years, ans, etc)
- end with zero or more other characters (any)
I've used :
/^[0-9]{2} +(ans|year)$/
so far but it only matches very specific strings like "24 year"