John (Yiannis) Toutountzoglou
asked on
Regular Expression
I do not have expirience about Reg's and i need some help
this Regular :
i need a regular expression like +30 (210) 5563535
this Regular :
\((?<AreaCode>\d{3})\)\s*(?<Number>\d{3}(?:-|\s*)\d{4})
gives me a result like (800) 325-3535 or (210) 556 3535i need a regular expression like +30 (210) 5563535
First part is an international code (max 9 digit plus + at the begging)
second part is area Code max 6 digit within parenthesis
third part is the actual tel number max 10 digits
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You got it in your second post ...
thank you very much ....
thank you very much ....
ASKER
i try to inert a specified Set of [0-9] to accept only numbers and it Match also if with letter...
"Your Syntax is correct.." ..i try this
"Your Syntax is correct.." ..i try this
\+(?<IntCode>\d{1,9}?[0-9])\s*\((?<AreaCode>\d{1,6}?[0-9])\)\s*(?<Number>\d{1,10}?[0-9])
What am i missing?
ASKER
For example if i set +30 (210) 5564fffff then it return true....
ASKER
My expression is
\+(?<IntCode>\d{1,9}?)\s*\((?<AreaCode>\d{1,6})\)\s*(?<Number>\d{1,10})
Open in new window
If you don't want the international code to be optional, and only match numbers with the international code, then try this:Open in new window