I am missing something very trivial in this regular expression. would you help me figure it out.
Valid Input: Tonny & 'One' 1234-5 tea be and Z
Regex: /^([a-zA-Z',\s,\d,&,#,-,(,)])*$/;
As per my current regex expression the input is not valid. Its a valid input as per reqs, wondering what I am missing in regex thats not validating the above input?
Your dash doesn’t match because in a character class you need to put the dash first or last. Also, you don’t need all those commas: