Jump to content

Regex: Difference between revisions

Line 131:
==IP Addresses==
 
1.* To Match upto 999.999.999.999:
\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b
OR shortened with a quantifier to:
\b(?:\d{1,3}\.){3}\d{1,3}\b
2.* To match exactly upto 255.255.255.255:
<pre style="width: 97%; overflow-x: scroll;">
\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b
Cookies help us deliver our services. By using our services, you agree to our use of cookies.