From: "David A. Black" Date: 2008-07-20T20:44:16+09:00 Subject: Re: filtering email addresses Hi -- On Sun, 20 Jul 2008, Luca Scaljery wrote: > thnx, makes sense > > How do you, BTW, exlude matches ? > > !str.scan(pattern) do > ... > end > > doesn't work. Also a regex like > /[^pattern]/ > > doesn't work str =~ /@/ It's absolutely not a robust way to check for an email address, but it will check for an at-sign :-) As for /[^pattern]/, that will match one character that is not a, e, n, p, t, or r. For non-matching, try: str !~ /pattern/ or maybe negative assertions in the regex. David -- Rails training from David A. Black and Ruby Power and Light: Intro to Ruby on Rails July 21-24 Edison, NJ Advancing With Rails August 18-21 Edison, NJ See http://www.rubypal.com for details and updates!