I'm currently working with Typescript and I've been exploring the idea of using regular expressions for a certain task.
The input data is in the form of a string:
"(0,1)(1,2)(3,1)"
There are several validations that need to be performed on this data:
- Every value should be a numeric digit.
- Each number must not exceed a certain variable value
x
set at runtime. - If all validations pass, I would like to extract the matches into an array while removing the parentheses around them.
Do you think this can be achieved using regular expressions?