I was making a regular expression which can have the phone number of any length and can have the ( + and ) anywhere in the number.
^[\s()+-]*([0-9][\s()+-]*){6,20}$
But this regular expression is taking the spaces in it which is not correct. can someone help me to change this?
Remove character class
\sfrom regex pattern to avoid matching whitespaces. Also escape parentheses()with backslashes as they are metacharacters: