From: Harold Hausman Date: 2006-09-16T13:04:07+09:00 Subject: Re: Regular expression for string.anotherstring On 9/15/06, Bart Braem wrote: > I'm trying to validate a user mail address for a fixed domain with the rule > string =~ /\w+\.\w+/ > this matches firstname.lastname, which is what I want. > But it also matches fistname.lastname@somedomain.com, which is not what I > want. Why does that match? I'm having this in Rails, but I guess the > quoting will not escape @ signs? > > Bart > > I'm no regex master but what about: /^[^@]+/ One or more things thats not an '@' at the beginning of the string? hth, -Harold