This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This pattern matches IPv4 private IP ranges, plus loopback address. | |
| // | |
| // Pattern 1 matches the beginning of the IP address only, so it cannot be used | |
| // in situations where the entire matched IP address is required. | |
| // | |
| // Pattern 2 returns the entire matched IP address. | |
| // | |
| // @see https://en.wikipedia.org/wiki/IP_address#IPv4_private_addresses | |
| var pattern1 = /^(127\.0\.0\.1)|(10\.)|(192\.168)|(172\.(1[6-9]|2[0-9]|3[0-1])\.)/g, | |
| pattern2 = /^(127\.0\.0\.1)|(10\.\d+\.\d+\.\d+)|(192\.168\.\d+\.\d+)|(172\.(1[6-9]|2[0-9]|3[0-1])\.\d+\.\d+)/g; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // This pattern matches the phone numbers ONLY (i.e. it does NOT match the | |
| // extension or text) in: | |
| // | |
| // 250-370-8517 or toll free 1-888-370-8517 | |
| // 250 370 8517 or toll free 1 888 3708517 | |
| // 250 370 8517 or toll free 18883708517 | |
| // 604-851-4700 Ext. 646170 | |
| // +12503708517 | |
| // 1.250.370.8517 | |
| // (250) 370-8517 |
NewerOlder