From: Mark Thomas Date: 2009-07-14T21:10:05+09:00 Subject: Re: a regex that does not contain comma On Jul 14, 4:25 am, Sijo Kg wrote: > Hi >   Thanks for the reply..And I tried in the rails project like > > validates_format_of :name, :with => /((?>\w+\s*(?=,))+)/ > >          And what I expect is if name has a comma anywhere validation > fails .Could you please tel how to get that? One way: in your active record model: def validate errors.add(:name, "has invalid format") if name.include? "," end Seems easier to read.