LostForWords1987
asked on
Javascript Regex Question
I need a JavaScript Regex to do the following:
Example 1 - String = '0:9,1:5,2:6,3:1'
Example 2 - String = '5:8'
I want to return everything after the ':' and before the ','.
Example 1 result:
9
5
6
1
Example 2 result:
8
Thanks
Example 1 - String = '0:9,1:5,2:6,3:1'
Example 2 - String = '5:8'
I want to return everything after the ':' and before the ','.
Example 1 result:
9
5
6
1
Example 2 result:
8
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You have to use split function twice here to get the required values.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys. That's exactly what I was looking for.
You are welcome.