On Thu, Oct 09, 2003 at 11:58:31PM -0700, [EMAIL PROTECTED] wrote:
> here's the rules:
> starts with alphanumeric
> 4 chars long
> require one period
> 
> /^[a-zA-Z][\w\-\.]{3,}$/

I wouldn't try to do it with one regex.  You can probably come
up with one, but the next time you have to read this code, you'll
wish you'd spelled out the three conditions individually.

  sub validate {
    local $_ = shift;
    return length == 4      # 4 chars long
       and tr/.// == 1      # require one period
       and /^[[:alpha:]]/   # starts with a letter
  }

-- 
Steve

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

Reply via email to