Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to fetch phone number from string C#

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

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>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
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading