<[EMAIL PROTECTED]> wrote:

> I need help creating a regular expression to do the following.
>
> I have the following numbers:
>
> 1006326869812
> 563296853235993
> 35968322963568389
>
> and it needs to be broken up like this
>
> 1006-3268-69812
> 563296-8532-35993
> 35968322-9635-68389
>
> Notice the second group of numbers is always 4 places and the last group
is
> always 5 places.
>
> I'm stumped and not to good with RE's. Any pointers would be great.

try this:

$number=~s/^(\d+)(\d{4})(\d{5})$/$1-$2-$3/;

hth,

-dave

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to