[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'?
> 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]