html5_validators
html5_validators copied to clipboard
Regexp support
Hi @amatsuda and thanks for great gem!
I want to know do you have any plans to support Regexp in a future? Seems like this library really helps to avoid duplication between client and server, but with regexp I have to copy them anyway.
Or, maybe you have any advice for that?
I have for example, validation in backend with
value =~ /\A(4|9)\d{7}\Z/
and for frontend:
<%= f.telephone_field(:phone,
placeholder: 'Mobile',
pattern: '^[49]\d{7}$') %>
that's a nice idea! :bulb: any reason why this haven't been implemented? :thinking: can I send a PR?