Regular Expressions 101

Sponsors

Library entries

1
pcre

PTK:DateOfIssuance

no description available
Submitted by anonymous - 7 years ago
1
pcre

Find Single Instance

no description available
Submitted by anonymous - 7 years ago
1
pcre

sdf

f
Submitted by f - 7 years ago
1
pcre

Timestamp from json

no description available
Submitted by Thomas Khalil - 7 years ago
0
pcre

parse velocity variables

no description available
Submitted by anonymous - 7 years ago
1
pcre

Does not match

no description available
Submitted by anonymous - 7 years ago
1
pcre

Originale

no description available
Submitted by anonymous - 7 years ago
1
pcre

Regexp for mediawiki

no description available
Submitted by anonymous - 7 years ago
5
pcre

Latitude,Longitude fetcher

Useful to work with GoogleMap API.
Submitted by anonymous - 7 years ago
1
pcre

tag replace

no description available
Submitted by Lexx918 - 7 years ago
2
pcre

Valmaks_rename_big_strings

no description available
Submitted by witamin - 8 years ago

ipv4 IP addressses, capturing private ranges

Vote

1

Regular Expression
pcre

/
# Match ipv4 IP addresses # Specifically capture private IPs before matching the more global # 0.0.0.0 - 255.255.255.255 octet ranges. ^(?P<private_10_ip> 10\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]) )$ | ^(?P<private_169_ip> 169\. 254\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]) )$ | ^(?P<private_172_ip> 172\. (?:1[6-9]|2[0-9]|3[0-1])\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]) )$ | ^(?P<private_192_ip> 192\. 168\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]) )$ | ^(?P<all_ip> (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5])\. (?:[01]?[0-9]{1,2}|2[0-4][0-9]|25[0-5]) )$
/
gmx

Description

Loading markdown...
Submitted by OnlineCop - 8 years ago