What will be the best way using javascript regular expression to get numbers out of text..
e.g…. I have “$4,320 text/followme” and I want to get 4320 out of this. However I want to avoid numbers after first occourance of an alphabet or any non alphabet other than a comma ‘,’
so that if i have $4,320 t234ext/followme it will still return me 4320.
The input will always have $ sign at the beginning
so the regular expression should return
$4,320 text/followme returns 4320
$4,320 t3444ext/followme return 4320
$4,320 /followme return 4320
$4320 text/followme return 4320
$4320 t3444ext/followme return 4320
$4320 /follow4me return 4320
1 Answer