Link to home
Start Free TrialLog in
Avatar of LostForWords1987
LostForWords1987Flag for United States of America

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
SOLUTION
Avatar of Rgonzo1971
Rgonzo1971

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You have to use split function twice here to get the required values.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LostForWords1987

ASKER

Thanks guys. That's exactly what I was looking for.
You are welcome.