-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
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?
>
> Sijo
This is how I tested it:

#! /opt/csw/bin/ruby

string = "Hello world"
regexp = /(?>\w+\s*(?=,))+/

if string =~ regexp
    puts "string contains a comma (validation failed)"
else
    puts "string does not contain a comma (validated)"
end

p string =~ regexp


Hope that helps

- --
Freundliche Grテシテ歹 / Kind regards

Axel Schmalowsky
Platform Engineer
___________________________________

domainfactory GmbH
Oskar-Messter-Str. 33
85737 Ismaning
Germany

Mobil:      +49 (0)176 / 10246727
Telefon:  +49 (0)89 / 55266-356
Telefax:  +49 (0)89 / 55266-222

E-Mail:   aschmalowsky / df.eu
Internet: www.df.eu

Registergericht: Amtsgericht M端nchen
HRB-Nummer 150294, Gesch辰ftsf端hrer:
Tobia Sara Marburg, Jochen Tuchbreiter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iEYEARECAAYFAkpcRnIACgkQsuqpduCyZM2aoQCgxreJYu9uST9u884FVvi6WIAS
EnYAni1qT+62Ltw4iPoUyXcB2qGIsHAh
=JTm5
-----END PGP SIGNATURE-----