On Jul 14, 4:25    󮮮 
> Hi
> Thanks for the reply..And I tried in the rails project like
>
> validates_format_of :name, :with => /((?>\w+\s*(?=,))+)/
>
>         
> 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.