Den 2010-09-12 14:19:27 skrev Malte Timmermann <[email protected]>:

If you are sure it's always 10 chars long:

Search:   ([0-9][0-9][0-9])([0-9][0-9][0-9])([0-9][0-9][0-9][0-9])
Replace:  $1-$2-$3

[0-9] means finding a digit
() is for grouping, so you can use the found string in the replace statement
$<n> is result of group <n>

HTH,
Malte.

Or, if you didn't like my suggestion yesterday about ([:digit:]{3})([:digit:]{3})([:digit:]{4}), then a mix of both suggestions could be:

([0-9]{3})([0-9]{3})([0-9]{4})

Replace is the same in all three cases:
$1-$2-$3

{x} means x instances of what's to the left of it.

So 3 digits followed by three digits followed by four digits will be replaced by the first three digits followed by a minus sign and so on.

--
Kind regards

Johnny Rosenberg

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to