Input with Regex
Created with CodeSandbox
Desription
This is an Input component that allows us to put restrictions on what can the user type in. For example,
<Input type="text" validationRegex={/[a-zA-Z]/} />
The validationRegex
prop accepts a RegExp object or a Regular expression. Both Paste and Typing are handled for a given regex by the input. If you don't pass validationRegex
, it works like a normal input box.