Try this.

$somestring =~ /^\d{14}$/;
# matches 0123456789123 but not 10123456789123

The ^ character matches the beginning of the string and the $ character
matches the end of the string.


> Hi all,
> I am trying to match a 14 digit number
> When i use this regular expression i match a 14 digit number and any
number
> over 14 digits.
>
> $somestring = ~ '/d{14}';
>
> I have tried these combinations with no avail.
>
> $somestring =~ '/d{14,14}';
> $somestring =~ '[0-9]{14,14}';
> $somestring =~ '[0-9]{14,14}?;
> $somestring =~ '/d{14}?';
> $somestring =~ '/d?{14,14}';
> $somestring =~ '/d?(14,14)';
> $somestring =~ '/d?[14,14]';
> $somestring =~ '/d{14,14}+';
>
>
> Regards
> Stuart Clark
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to