Results 1 to 2 of 2

Thread: Need help tweaking a line of code

  1. #1
    Join Date
    Apr 2013

    Need help tweaking a line of code

    Hi there, hope you all are doing well.

    I downloaded a firefox add-in from the VOIP hosting provider for my company. The function is it detects phone numbers in the browser and makes them clickable. Unfortunately this line of code makes it read numbers as (512)123-1234. What we need it to do is detect numbers as one solid block of 10 digits, like 5121231234. I have tried some changes to no avail. I believe this line of code that I paste below is responsible for determining what is detected from a webpage with it currently only detecting numbers like (512)123-1234. Does someone know what this line of code needs to be written as, or am I looking in the wrong spot? Thanks!

    var phone_number_regex_us = /(?:[^\&\*\=\/\\\%\#\$\w\+\-\.\,]|^)\s*(?:\+\s*1|1)?\s*[\(\-\.]?\s*(?:8[05678]{1}[0-9]{1}\s*[\)\-\.]?\s*[0-9a-zA-Z]{3}\s*[\-\.]?\s*[0-9a-zA-Z]{4}|[2-9]{1}[0-9]{2}\s*[\)\-\.]?\s*[0-9]{3}\s*[\-\.]?\s*[0-9]{4})/;

  2. #2
    Join Date
    Jan 2010
    Hi bud
    The regex for ten digits in a row is:

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center