Uuups, seems I missed Johnny's suggestion yesterday - stopped reading
when it seemed to be a format-cell solution only to me...

Malte.

Johnny Rosenberg wrote, On 09/12/10 15:56:
> Den 2010-09-12 14:19:27 skrev Malte Timmermann  
> <malte.timmerm...@oracle.com>:
> 
>> 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.
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@openoffice.org
For additional commands, e-mail: users-h...@openoffice.org

Reply via email to