I currently have this regex string and i am getting a Unterminated regular expression literal error in my react code
const check_number = /^[0]\d{10}$)|(^[\+]?[234]\d{12}$
does anyone know how to fix this.
The exact syntax error is being caused by a missing / ending delimiter (and a few other things). But, your regex has other problems. Use this version:
const check_number = /^(?:0\d{10}|[+]?[234]\d{12})$/
The above pattern matches phone numbers which either:
/^(?:0|\+?[234]\d\d)\d{10}$/instead