The problem happened when trying to validate an email against Devise default regex.
Changing the default validation regex can be a problem as it ensures that an email is not spread over many lines. This is not critical for client side validation. That's why my preferred choice was to replace the characters with ^ and $ on the generated expression. We can then keep the strong validation on the server side.
I'm available if you've got any question on that topic.
Yann for the Silicon Salad Team
Manage case when validating format against a regexp using the charact…
- Replaces '\A' with ^ and '\z' with $. Not the same meaning but enough for client-side validation
Funnily enough, we had to deal with this exact problem earlier this week. It was related to the email_regexp config option in our old version of Devise.
I'm happy to tackle this soon as I am aware that format validation in Judge needs some work. Tokenizing is a bit of a glaring omission too, for example. :)
For now, my advice is to either change your server side regexp to use ^ and $, or keep on using your forked version of Judge – whichever you feel most comfortable with.
Thanks for your quick answer.
We will carry on with our fork for now, but I completely agree with your point of view. We have been discussing about the issue you're talking about and decided that replacing these two characters should cover at least 80% of the needs (usually ensuring that an expression stays only on one line).
But you're right saying that it should be fully generic and relying on a specific project managing these differences.
I would be happy to help you integrating the solution you're talking about if you need.
Finally I'd like to say that we really like this Gem which is really useful and of great quality.
Thank you for your great work.
I'm glad you guys agree. Thanks for the kind words! I'll try and remember to give you a shout when I've started on the XRegExp integration.