You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* 9. Group that is used to determine if there is a phone number match. The
1548
1548
* next 3 groups give segments of the phone number.
1549
-
* 10. (Optional) Group that matches the area code of a phone number. Will
1550
-
* be an empty string if not included in the number.
1551
-
* 11. Group that matches the first 3 digits of a US phone number.
1552
-
* 12. Group that matches the last 4 digits of a US phone number.
1553
1549
*/
1554
1550
matcherRegex : (function(){
1555
1551
vartwitterRegex=/(^|[^\w])@(\w{1,15})/,// For matching a twitter handle. Ex: @gregory_jacobs
1556
1552
1557
1553
emailRegex=/(?:[\-;:&=\+\$,\w\.]+@)/,// something@ for email addresses (a.k.a. local-part)
1558
-
phoneRegex=/\(?(\d{3})\)?[-]?(\d{3})[-]?(\d{4})/,// ex: (123) 456-7890, 123 456 7890, 123-456-7890, etc.
1554
+
phoneRegex=/(?:\+?\d{1,3}[-\s.])?\(?\d{3}\)?[-\s.]?\d{3}[-\s.]\d{4}/,// ex: (123) 456-7890, 123 456 7890, 123-456-7890, etc.
1559
1555
protocolRegex=/(?:[A-Za-z][-.+A-Za-z0-9]+:(?![A-Za-z][-.+A-Za-z0-9]+:\/\/)(?!\d+\/?)(?:\/\/)?)/,// match protocol, allow in format "http://" or "mailto:". However, do not match the first part of something like 'link:http://www.google.com' (i.e. don't match "link:"). Also, make sure we don't interpret 'google.com:8000' as if 'google.com' was a protocol here (i.e. ignore a trailing port number in this regex)
1560
1556
wwwRegex=/(?:www\.)/,// starting with 'www.'
1561
1557
domainNameRegex=/[A-Za-z0-9\.\-]*[A-Za-z0-9\-]/,// anything looking at all like a domain, non-unicode domains, not ending in a period
0 commit comments