Looking for regex expression (for php) to replace patterns multiple times without affecting remainder. The actual replace required is to reverse certain numbers, 10-1 should be changed to 1-10, i.e. "number1" "dash" "number2" where number is integer (could have more than 1 digit) should be replaced by "number2" "dash" "number1". Note that the pattern does not allow spaces. This pattern can occur any (unknown) number of times including 0.
This text can be surrounded by any other text including numbers, letters, spaces, special characters.
Examples
asdasdasd10-1 2-3asdasd 9-2 2 3XSSADSD
should be changed to
asdasdasd1-10 3-2asdasd 2-9 2 3XSSADSD
Similarly
<asdasd 10 - 2 dfdsfsdfsdf 8-2
changed to
<asdasd 10 - 2 dfdsfsdfsdf 2-8