> -----Original Message-----
> From: Rob Dixon [mailto:[EMAIL PROTECTED]
> Sent: Friday, October 03, 2003 4:19 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Validate String w/required period
>
>
> [EMAIL PROTECTED] wrote:
> >
> > I'm trying to validate if a string contains \w and required
> atleas one
> > period (.)
>
> By \w do you mean just whitespace or '\\w'?
Isn't \w a-zA-Z0-9_ ??
And whitespace \s ??
>
> > This one check but does not require a period. Can someone change it
> > please?
> >
> > sub isValidDomain { return shift =~ /^[\w\.]{3,}$/ }
>
> - Do you really need a subroutine? It may help as it
> self-documents your program, which is named well.
>
> - What your regex matches is any string which is at
> least three character in length and contains only
> whitespace or periods.
>
> Code up your English-language description:
>
> if $a_string =~ /\w/ and $a_string =~ /\./
>
> I hope that helps.
>
> Rob
>
>
>
> --
> 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]