From: MonkeeSage Date: 2006-09-18T08:51:17+09:00 Subject: Re: Regular expression for string.anotherstring Bart Braem wrote: > One question though: why does \w match with '@'? According to the > documentation \w == [a..zA..Z]??\w doesn't match @, it's just that your expression was too general: test = lambda { |x| p $1 if x =~ /(\w+\.\w+)/ } test.call('down@fraggle.roc') # => "fraggle.roc" test.call('foo.bar@baz') # => "foo.bar" I.e., you were matching on either side of the @ Regards, Jordan