How to split and select which is number using regex. User can enter string like:
1dozen
3 dozen
dozen1 <= unlikely but assume user will type that too
30/kg
I still find out with the incomplete one:
/[a-z](?=\d)|\d(?=[a-z])/i
But missing space and forward slash. Can anyone help me?
The lookarounds are completely unnecessary here!
See http://jsfiddle.net/5WJ9v/
The code:
You get a match object with all of your numbers.
The script above correctly alerts
1,3,1,30.