I have a string in the form: "xMyS"
I want to extract x and y in using the Javascript Regex expressions.
For example, if the string is
10M225S
I need 10 and 225 from this.
Also, the string might not have either of x or y part. For example it can be just 225S or just 10M.
EDIT: I tried things like .match(), but don't know how to extract values in the mentioned format.
EDIT: The regex I tried so far is /(\w+)M(\w+)S/, but it seems to only work for 10M225S and not for 10M and 225S.