Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
find phone number in string
#4
thanks for the reply

Those two are close but not quite what i need..

i dont want a list. All i want is the first phone number in selected text
I just want the first 10 digit phone number in the text that i select on web page. (no matter whats at the start or end of phone number)
so start with the first character thats a digit (1234567890)
and end with the 10th digit after the first, removing all non digits in between like "().- spaces"

Example 1:
phone: 800-123-1234x12345
new line with other text

Example 2:
myphone: (800)123-1234 x12

Example 3:
your phone number: 800.123.1234

Example 4:
your phone number: 800 123 1234

what i need to end up with:
string s= "8001231234"

thanks for your help with this


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)