I have string in format as below:
ABC 318 XY2388
I tried to use preg replace function in PHP with Regex but having no knowledge of reg ex I am not getting anywhere.
I want above string to end up like ABC 318/XY 2388
So the rule is:
- Keep the first ABC (first batch of letters) untouched.
- Put a space between letter(s) and number occurring after ABC.
- replace space between second batch of numbers and letters with forward slash
I will appreciate any help on this.
ABC
and318
, but not betweenXY
and2388
- that doesn't match your description. – Tim Pietzcker Jul 9 '13 at 14:57