Reputation: 25870
I have a regex that matches a phone number but only if it's the only thing in a string. I need to be able to find a phone number in something like: "This is your phone number: 111.222.1111. OK?"
.
My current Regex:
/(^\(\d{3}\)( |-|\.)?\d{3}( |-|\.)?\d{4}$|^\d{3}( |-|\.)?\d{3}( |-|\.)?\d{4}$|^[0-9]{10,10}$)/g
How can I modify this to find phone numbers within a string?
Upvotes: 0
Views: 103