Reputation: 2730
I want to allow only numbers which do not start with zero.
I have used the regex ^((?!(0))[0-9]+)$
which worked fine when I tested it with https://www.regextester.com/1926 but in my react app its not working fine.
Can anybody tell me what I am doing wrong here?
EDIT
Here is my code
const sharenumberRegex = /^((?!(0))[0-9]+)$/;
estimatedShareValue: Yup.string()
.matches(sharenumberRegex, "Invalid number")
.required('*Please type positive number'),
Upvotes: 0
Views: 938