react-form-builder icon indicating copy to clipboard operation
react-form-builder copied to clipboard

Email input validator pattern

Open FranciscoValdesoiro opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe. We need to apply pattern validators

FranciscoValdesoiro avatar Feb 05 '21 09:02 FranciscoValdesoiro

The current email pattern /^(([^<>()[]\\\\.,;:s@\\\"]+(.[^<>()[]\\\\.,;:s@\\\"]+)*)|(\\\".+\\\"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/ in the example does not work for email addresses. Try entering a valid email at https://regex101.com/ using this pattern and it does not match. Try regex pattern /\S+@\S+\.\S+/ instead. In the JSON form template it would need to be escaped like the following.

        "registerConfig": {
          "required": true,
          "pattern": "/\\S+@\\S+\\.\\S+/"
        }

The regex patterns within the form template do not seem to be working currently. (I tried cloning the repository and setting up the development server locally but kept running into errors trying to get the examples to run, so I'm not sure what is going on with that.)

kuhlaid avatar Nov 17 '21 19:11 kuhlaid