I have following regulare expression string
(\d+)(((.|,)\d+)+)?(ms|s| ms| s)
It validates if user entered a correct string for milliseconds and seconds.
Example of possible values are
- 100ms
- 100s
- 100 ms
- 100 s
- 52.55 s
for further operations I need to seperate out the string and the number, for example, if value entered is 123.45ms I should get 123.45 and ms.
As of now I’m only getting the number and string is lost!
I can split the numbers and string in two different steps, but I’m interested in doing at once, any suggetions how can I do it?
You use groups: