Regex 10 Digit Phone Number with Dashes

Home Forums Quform WordPress Regex 10 Digit Phone Number with Dashes

This topic is: not resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #36643
    acewebsites
    Participant

    I am trying to use a validator or filter for Regex to automatically add dashes to a 10 digit phone number, like this 000-000-0000, but nothing seems to be working. The phone number continues to only output the number as 0000000000.

    I have added these to the Regex Validators:

    / ^(?=[0-9]{10})([0-9]{3})([0-9]{3})([0-9]{4})$ /
    also tried this
    / ^\(?\d{3}\)?[\s.-]?\d{3}[\s.-]?\d{4}$ /

    Where am I going wrong?

    #36646
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy