judgegem / judge

Client-side form validation for Rails
MIT License
256 stars 41 forks source link

Judge validator format does not work correct with some regex? #28

Closed tommyalvarez closed 10 years ago

tommyalvarez commented 10 years ago

/^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$/i is a rub regex for simple mail format validation.

Judge will fail the test for an emal like "anemail@adomain.com" without the quotes. I believe the problem is in the /i part of the regex not been correctly transformed by judge into a case insensitive/insensitive modifyer for javascript.

Vadorequest commented 10 years ago

You need to use regexes that are compatible with JS too. I also run into this kind of issues.

https://github.com/joecorcoran/judge/issues/25

tommyalvarez commented 10 years ago

I thought there was some ruby to javascript regex converter embedded in the gem. Thanks! Im closing the issue leaving the reference to #25