On Jul 14, 4:25=A0am, Sijo Kg <s... / maxxion.com> wrote:
> Hi
> =A0 Thanks for the reply..And I tried in the rails project like
>
> validates_format_of :name, :with =3D> /((?>\w+\s*(?=3D,))+)/
>
> =A0 =A0 =A0 =A0 =A0And what I expect is if name has a comma anywhere vali=
dation
> 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.