-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Sebastian said:
Am Dienstag 14 Juli 2009 12:01:23 schrieb Axel Schmalowsky:
Trying the regexp /^[^,]*$/ fails with the code below:
[...]
Am I missing sth?
Your code expects the regex to match if the string contains a comma and not
match if the string does not contains a comma. That's the opposite of what
Justin's regex does and also the opposite of what the Sijo asked for.
Also if the goal had been to have the regex match if there is a comma /,/
would have sufficed as a regex.
Also note that with your regexp your code outputs "string does not contain a
comma" for the string ",".
Well, negative logic .. ;-)
This regexp matches correctly if the string consists only of a comma:
/(?>(?:\w+\s*)*(?=,))+/
- --
Freundliche Grüße / 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: (e-mail address removed)
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
iEYEARECAAYFAkpcYm8ACgkQsuqpduCyZM1itQCfZDT+img/utF3v72MxZFIcNTO
gTMAn3mf1/4dIyQdqv5XQz16jyD1j3Sr
=rY8S
-----END PGP SIGNATURE-----