in reply to Re: regexp to only allow for formally valid email addresses
in thread regexp to only allow for formally valid email addresses

$ perl -le '$_ = "oh really?"; print unless /[.]/;' oh really?

Replies are listed 'Best First'.
Re^3: regexp to only allow for formally valid email addresses
by hangon (Deacon) on Mar 07, 2007 at 20:16 UTC

    Unless you don't think the character classes are a bit redundant. I assume fraktalisman only wants to match \w as well as '-' and '.' since its for e-mail addresses.

    # my guess is that he's not trying to do this =~ /^[.]+@[.]+$/ # either of these make more sense for matching an e-mail address =~ /^[a-zA-Z_\-\.0-9]+@[a-zA-Z_\-\.0-9]+$/ =~ /^[\w\-\.]+@[\w\-\.]+$/

    Or am I missing something painfully obvious?

      The dot is not special within square brackets. /[.]/ only matches ".", not "a".