Regular Expressions 101

Library entries

1
python

Category and subitems

Categories with items name, type and size
Submitted by Alex - 8 years ago
1
pcre

aabc lazy capture

no description available
Submitted by anonymous - 8 years ago
1
javascript

pure url and uri

no description available
Submitted by Thiago Souza - 8 years ago
1
pcre

Cleaning up epub converts

no description available
Submitted by Cory - 8 years ago
1
pcre

HTTP => HTTPS

Force all URLs to HTTPS.
Submitted by WhatIsHeDoing - 8 years ago
1
pcre

Youtube ID

get youtube video ID
Submitted by anonymous - 8 years ago
1
javascript

Floating Point

Tests a floating point number
Submitted by Josh L. Rasmussen - 8 years ago
3
pcre

Currencies

Matches numbers formatted like currencies
Submitted by elgehelge - 8 years ago
0
python

Clojure

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

BEM for css

no description available
Submitted by giacomozinetti - 8 years ago
-2
javascript

domain name

no description available
Submitted by anonymous - 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