Any ideas?
The obvious way:
$oldstring = '123456789';; $oldstring =~ s[(...)(...)(...)][$1 $2-$3];; print $oldstring;; 123 456-789
In reply to Re: Use Regular Expression to add spaces to a string
by BrowserUk
in thread Use Regular Expression to add spaces to a string
by omegaweaponZ
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |