Based on this question Regex \d+(?:-\d+)+ will match this 10-3-1 and 5-0.
Example:
This is 10-3-1 my string
After performing the matching and reversing, I want it to be like this:
This is 1-3-10 my string
Notice that 10-3-1 should become 1-3-10 and not normal string reverse which would result in 1-3-01.
A basic algorithm would be:
"10-3-1"["10","3","1"]["1","3","10"]"1-3-10"