'I am trying to find at least one digit in a string but i am getting an error below
I am trying to find at least one digit in a string by using regular expression but i dont know why it is not working
const password = 'sadrFeff4ss5';
const isExistsNumber = /^(?=*[0-9])/.test(password);
const isExistsNumber = /^(?=.[0-9])/.test(password); Here the regex pattern /^(?=[0-9])/ should find one number from the sring 'sadrFeff4ss5' but i am getting an syntax error Module parse failed: Invalid regular expression: /^(?=*[0-9])/: Nothing to repeat (53:28); I can't figure out where the problem is.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
