I'm still a newbie when it comes to regular expressions. I'm OK with matching and replacing strings, but I'm trying to use re's to take a single string and add spaces to it. See example below:
$oldstring = '123456789'
-- regular expression function --
$newstring = '123 456-789'
Any ideas? I'm assuming it's based on counting characters based on .. as those characters will constantly change, but the order in which I need them to add a space or - will not
In reply to Use Regular Expression to add spaces to a string by omegaweaponZ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |