Hello i have this string that looks like this:
10+ years in business · Peterborough, ON, Canada
Closed ⋅ Opens 9AM · +1 705-745-8390
Now i want to fetch the number using regex but i need the proper format to fetch only the phone number like this +1 705-745-8390. Is it possible to do such format in regex?
Thank you in advance
>Solution :
Regex:
\b\+\d+ \d{3}-\d{3}-\d{4}\b
Valid for:
- +91 345-286-2346
- +1 345-286-2346
- +44 345-286-2346