RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Advanced Search

Keywords

Category

Minimum Rating

Results per Page

Search Results: 18 regular expressions found.

   Displaying page 1 of 1 pages; Items 1 to 18
Title Test Details Pattern Title
Expression
^([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}$
Description
IPv6 text representation of addresses without compression from RFC 1884. This regular expression doesn't allow IPv6 compression ("::") or mixed IPv4 addresses.
Matches
FEDC:BA98:7654:3210:FEDC:BA98:7654:3210 | 1080:0:0:0:8:800:200C:417A | 0:0:0:0:0:0:0:1
Non-Matches
128.0.0.1 | FEDC:BA98:7654:3210:FEDC:BA98:7654:3210:AA31 | ::1
Author Rating: Not yet rated. Mikko Puonti
Title Test Details Pattern Title
Expression
^((?:2[0-5]{2}|1\d{2}|[1-9]\d|[1-9])\.(?:(?:2[0-5]{2}|1\d{2}|[1-9]\d|\d)\.){2}(?:2[0-5]{2}|1\d{2}|[1-9]\d|\d)):(\d|[1-9]\d|[1-9]\d{2,3}|[1-5]\d{4}|6[0-4]\d{3}|654\d{2}|655[0-2]\d|6553[0-5])$
Description
IPv4 ip:port checker, I hope it will help you. $1 - IP, $2 - port. More to come, maybe :)
Matches
127.0.0.1:80 | 255.255.255.0:21 | 1.0.0.0:1
Non-Matches
0.0.0.0:1 | 256.1.1.1:20 | 127.0.0.1:65536
Author Rating: The rating for this expression. Brano Gerzo
Title Test Details IPV4 and IPV6 address
Expression
([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4}|(\d{1,3}\.){3}\d{1,3}
Description
Matches all IPV6 and IPV4 addresses. Doesn't limit IPV4 to just values of 255. Doesn't allow IPV6 compression.
Matches
0:123:af00:ffff:0C67:0:0:8787 | 0:0:0:0:0:0:0:1 | 0.0.0.1 | 999.999.999.999
Non-Matches
::1
Author Rating: The rating for this expression. John Wilkins
Title Test Details Match IP Address
Expression
\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?
Description
Quick and simple way of matching a well-formed IPV4 (dotted quad) ip address.
Matches
192.168.1.19
Non-Matches
19x.168.1.19
Author Rating: Not yet rated. Fred Miller
Title Test Details IPv6 (and IPv4) Address match with optional Port Number
Expression
(^|\s|(\[))(::)?([a-f\d]{1,4}::?){0,7}(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?=(?(2)\]|($|\s|(?(3)($|\s)|(?(4)($|\s)|:\d)))))|((?(3)[a-f\d]{1,4})|(?(4)[a-f\d]{1,4}))(?=(?(2)\]|($|\s))))(?(2)\])(:\d{1,5})?
Description
Too complex for a short explanation. It doesn't check for valid IP ranges and it also doesn't obey the rule, that a double colon in IPv6 only can exist once in the address notation. The optional port match at the end can be omitted. The RegEx has been constructed the way, that if an explicit identification fails, the complete match fails. For example someone write "My adress:2001::1234" the match will fail 'cos of the leading colon, even though it's an valid IPv6 address. A "My adress: 2001::1234" or "My adress:[2001::1234]" will work. Beware, that the RegEx is build for case-insensitive usage and no whitespaces are allowed inside the address. If you want to embed it into a larger RegEx, take into account to adjust the conditional matches wich refers to (?(2) -> (\[) inside (^|\s|(\[)) and (?(3) -> (::)? and (?(4) -> ([a-f\d]{1,4}::?) Works not perfectly, but I'm currently out of time.
Matches
::ffff:21:7.8.9.221 | 2001:0db8:85a3:08d3:1319:8a2e:0370:7344 | ::8a2e:0:0370:7344 | 2001:0db8:85a3:08d3:1319:8a2e:100.22.44.55 | 2001:0db8::8a2e:100.22.44.55 | ::100.22.44.55 | 100.22.44.55 | 100.22.44.55:80 | [::100.22.44.55]:8080 | [20ff::100.22.44.55]:8080
Non-Matches
20ff::100.22.44.55:8080 | ::8a2e:0:0370:7344.4 | 2001:0db8::8a2e:100.22.44.55:8080 | 2001:idb8::111:7.8.9.111 | 2001::100.a2.44.55 | :2001::100.22.44.55 | ffff:: (has to be fixed, 'cos a valid address)
Author Rating: Not yet rated. Gerry
Title Test Details IPv4 Address match
Expression
(?:^|\s)([a-z]{3,6}(?=://))?(://)?((?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.(?:25[0-5]|2[0-4]\d|[01]?\d\d?))(?::(\d{2,5}))?(?:\s|$)
Description
Address match with optional match of protocol and port. Use case-insensitive. The matching brackets are: bracket 1 = optional protocol without :// -- bracket 3 = IPv4 address, with a more likely correct number range -- bracket 4 = optional port without : as an separator. Should work fine.
Matches
192.168.12.34 | 192.168.12.34:8080 | Link: https://202.133.76.34:80 | ftp://77.66.5.4
Non-Matches
262.133.76.34:80 | 262.133.76.34:1 | https:// 202.133.76.34:80 (matches not the protocol 'cos of the space)
Author Rating: Not yet rated. Gerry
Title Test Details ipv4 IP Address
Expression
^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})){3}$
Description
This matches any valid IPV4 IP Address. It includes 0-255 range checks since none of the IP components may exceed 255.
Matches
97.67.44.20 | 199.154.37.214 | 127.0.0.1
Non-Matches
63.125.94.287 | 140.370.a.187 | 94.923.1
Author Rating: The rating for this expression. jteeuwen
Title Test Details IPv6 Address
Expression
(^\d{20}$)|(^((:[a-fA-F0-9]{1,4}){6}|::)ffff:(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})(\.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[0-9]{1,2})){3}$)|(^((:[a-fA-F0-9]{1,4}){6}|::)ffff(:[a-fA-F0-9]{1,4}){2}$)|(^([a-fA-F0-9]{1,4}) (:[a-fA-F0-9]{1,4}){7}$)|(^:(:[a-fA-F0-9]{1,4}(::)?){1,6}$)|(^((::)?[a-fA-F0-9]{1,4}:){1,6}:$)|(^::$)
Description
This matches all valid forms of an IPv6 address. Including the compatibility form used to map IPv4 addresses. As well as the base-85 encoded integer form. It takes care of value range checking on the ipv4 part (components cannot exceed 0-255). This has been tested quite thoroughly, but considering the complexity and possibilities in the formation of an IPv6 address, matching errors are not guaranteed to be absent.
Matches
::5:aef1:ffff | ::ffff:240.65.238.22 | 0:0:0:0:0:0:0:1
Non-Matches
79250:9a0: | 8 | 91cf91d3da9
Author Rating: The rating for this expression. jteeuwen
Title Test Details IPv4, udp/norm protocol with port
Expression
^(udp|norm)://(?:(?:25[0-5]|2[0-4]\d|[01]\d\d|\d?\d)(?(?=\.?\d)\.)){4}:\d{1,6}$
Description
Based on ip regex listed in source. Expanded to require udp:// or norm:// protocol at the start and :12345 port number at the end (1-5 digits). Written to answer a forum question. Current limitations - only allows lowercase protocol names and doesn't block ports that start with 0.
Matches
norm://125.24.65.11:80 | udp://125.24.65.11:80
Non-Matches
125.24.65.11:80 | norm://125.24.65.11 | www.NotAnIp.com
Author Rating: Not yet rated. Matthew Harris
Title Test Details Validate IP port number (1-65535)
Expression
:(6553[0-5]|655[0-2][0-9]\d|65[0-4](\d){2}|6[0-4](\d){3}|[1-5](\d){4}|[1-9](\d){0,3})
Description
This was based on the regex in the source but it was buggy so I fixed it and then optimized it. It matches port numbers in the form of :1 to :65535 This is designed to be plugged onto the end of your favourite url regex because when I was looking for a IPv4 regex I noticed that a lot of them either didn't match the port or matched it badly (allowing the port number to start with a 0 or be higher than 65535) This regex solves those two problems.
Matches
:1 | :65535 | :2546
Non-Matches
:99999 | :0684 | :2ab23
Author Rating: Not yet rated. Matthew Harris
Title Test Details IPV4 and IPV6 address
Expression
^(((([1]?\d)?\d|2[0-4]\d|25[0-5])\.){3}(([1]?\d)?\d|2[0-4]\d|25[0-5]))|([\da-fA-F]{1,4}(\:[\da-fA-F]{1,4}){7})|(([\da-fA-F]{1,4}:){0,5}::([\da-fA-F]{1,4}:){0,5}[\da-fA-F]{1,4})$
Description
IPV4 and IPV6 address
Matches
10.11.12.13 | ::1 | fe80::2d3d:3489:63e3:35eb
Non-Matches
3.2.1 | 1::1::1 | 1:2:3:4:5:6:7:8:9
Author Rating: The rating for this expression. bxliu
Title Test Details IPv6 addresses including compressed and IPv4-embedded variants (RFC 2373)
Expression
(::|(([a-fA-F0-9]{1,4}):){7}(([a-fA-F0-9]{1,4}))|(:(:([a-fA-F0-9]{1,4})){1,6})|((([a-fA-F0-9]{1,4}):){1,6}:)|((([a-fA-F0-9]{1,4}):)(:([a-fA-F0-9]{1,4})){1,6})|((([a-fA-F0-9]{1,4}):){2}(:([a-fA-F0-9]{1,4})){1,5})|((([a-fA-F0-9]{1,4}):){3}(:([a-fA-F0-9]{1,4})){1,4})|((([a-fA-F0-9]{1,4}):){4}(:([a-fA-F0-9]{1,4})){1,3})|((([a-fA-F0-9]{1,4}):){5}(:([a-fA-F0-9]{1,4})){1,2}))
Description
This RE recognizes IPv6 addresses for all the representations described by RFC 2373: 1) extended format (with both upper and lowercase HEX) 2) compressed format (eg 2001::6:a) 3) IPv4-embedded format (eg ::ffff:1.2.3.4) limited to addresses of the traditional dual-stack configuration Resulting from observation of real-world implementations, case 2) is extended to allow "::" for one 0-group alone. Although the RFC is clear on "::" being for "multiple groups of 16-bits of zeros" only, some tools like "dig" for the mac produce those values. The RE is simple and quite elegant; it has been tested on over 300 IPv6 addresses collected by dig-ing IPv6-enabled domains; it is used in sshguard's log parser, see http://www.sshguard.net .
Matches
2001:470:b0b4:1:280:c6ff:fef2:9410 | 2001:868:100::3 | 2001:888:144a::a441:888:1002 | ::1 | a:b:: | ::FFFF:1.2.3.4
Non-Matches
1:2:3:4:5:6:7:8:9 | a::b::c | x:x:x:x:x:x:x:x
Author Rating: Not yet rated. mij
Title Test Details Ultimate URL URN Regex
Expression
^((nntp|sftp|ftp(s)?|http(s)?|gopher|news|file|telnet):\/\/)?(([a-zA-Z0-9\._-]*([a-zA-Z0-9]\.[a-zA-Z0-9])[a-zA-Z]{1,6})|(([0-9]{1,3}\.){3}[0-9]{1,3}))(:\d+)?(\/[^:][^\s]*)?$
Description
Finally, an expression that can reliably match any valid URL/URN! Future proof against vanity TLDs, doesn't require a schema, can parse IPv4s with or without port, can parse regular URLs with/without port, can accept extra baggage at the end, and, with a slight modification (a la ^$ and changing the final rule around a bit) this can be used to find and activate URLs in bodies of text safely and reliably. Have fun (tell me if it could be improved)!
Matches
http://www.google.com/#sclient=psy&hl=en&q=this+is+a+google+serach+%5E((Csftp)%3A%2F%2F)%3F((%5Ba-zA-Z0-9%5C._-%5D%2B%5C.%5Ba-zA-Z%5D%7B2%2C7%7D)%7C((%5B0-9%5D%7B1%2C3%7D%5C.)%7B3%7D%5B0-9%5D%7B1%2C3%7D))(%3A%5Cd%2B)%3F(%2F%5Ba-zA-Z0-9%5C%26amp%3B%25_%5C.%2F-~-%23%5D*)%3F%24&aq=f&aqi=&aql=&oq=&gs_rfai=&pbx=1&fp=ca05a7bb65e82229 | http://192.168.1.1:5649
Non-Matches
htttp://google.com | http://google-.com | http://google.123 | http://google.commmmmm | http://123.456.789.1231
Author Rating: The rating for this expression. Xunnamius
Title Test Details IPv4
Expression
\b([0-1]?\d{1,2}|2[0-4]\d|25[0-5])(\.([0-1]?\d{1,2}|2[0-4]\d|25[0-5])){3}\b
Description
Matches any IPv4.
Matches
192.168.11.12 | 123.123.123.012 | 0.0.0.1
Non-Matches
192.168.11 | 256.10.11.12 | 10.101.1.900 | 192.168.1. 2 | 192.168.10.0001
Author Rating: Not yet rated. Florian Cechi
Title Test Details Basic Email Validation
Expression
^([a-z0-9]+[.+-])*([a-z0-9]+)+@(([a-z0-9]+[.-])+([a-z]{2,})$|(([0-9]|[1-9][0-9]|1[0-9]{1,2}|2[0-4][0-9]|25[0-5])(\.|$)){4})
Description
Validates most common varieties of email addresses. Will accept domain with character-valid TLD, and also will accept an IPv4 address. It doesn't support validation of IPv6 address. Will also accept a valid username with tags.
Matches
Non-Matches
Author Rating: Not yet rated. Slavik Meltser
Title Test Details Bash 'traceroute' IPv4 Finder
Expression
\(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\)
Description
This regex finds the IPs in its route. This uses the UNIX Bash 'traceroute' command's IP format
Matches
(8.8.8.8) | (127.0.0.1)
Non-Matches
(a.sg.af.) | 8.8.8.8
Author Rating: Not yet rated. Regexmaker9000
Title Test Details IP address IPv4 (127.0.0.1)
Expression
((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])
Description
IP address IPv4 (127.0.0.1) . From http://tools.twainscanning.com/getmyregex .
Matches
127.0.0.1
Non-Matches
127-0-0-1
Author Rating: Not yet rated. RobertKaw
Title Test Details IPv4 Address
Expression
^((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.|$)){4}\b
Description
Match valid IPv4 address. Constraints: matches only IP. All numbers must be between 0-255 for each block, delimited by dots, and cannot be zero padded or be suffixed by a dot on the last class.
Matches
0.0.0.0 | 192.168.1.35 | 169.254.0.0
Non-Matches
127.0.0.01 | 255.255.255.256 | 7.7.7.7.
Author Rating: The rating for this expression. Brendan Rosa
   Displaying page 1 of 1 pages; Items 1 to 18

Copyright © 2001-2025, RegexAdvice.com | ASP.NET Tutorials