joecorcoran/judge — pull request #5 by yannirbah-silicon (2012-04-18 13:43:19+00:00)
Title: Manage case when validating format against a regexp using the characters...

... '\A' and '\z' not supported in Javascript :

- Replaces '\A' with ^ and '\z' with $. Not the same meaning but enough for client-side validation

The problem happened when trying to validate an email against Devise default regex.

'\A' and '\z' are not recognized by the javascript regexp engine, causing the validation of an e-mail failing all the time.

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.