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?

I think you want this: "string.string", but you don't want this:
"string.string@domain". Yes?

Have you tried:

string =~ /^\w+\.\w+$/

"^" means match at the beginning of the string, "$" means match at the end.
IOW the example must match the entire string. Is this what you wanted?

-- 
Paul Lutus
http://www.arachnoid.com