This is a simple problem but I'm wasting too much time trying to figure it out on my own.
I had data stored in strings with the pattern r{N}-{N}s{N} where {N} is a one or two digit number. This pattern can repeat up to 5 times. I need to extract the numbers from the pattern, preferably grouped somehow.
For example, if the string were "r4-10s5", I want to extract {4,10,5}
If the string were "r4-10s5r6-7s8" I want to extract {4,10,5} {6,7,8}
How could I get this done in PHP?
I have tried using recursive regular expressions but I cannot get them to match properly.