I'm currently using a regular expression to validate phones in the following format:
(xx) xxxxx-xxxx
It accepts only numbers that have this exact format. I would like to know how to modify the expression to accept numbers with either 9 digits (cell phones), either with 8 (fixed), something like:
(xx) [x] xxxx-xxxx
The expression follows.
/^\([0-9]{2}\) [0-9]{5}-[0-9]{4}$/