Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: IP Filtering RegEx needed

by Dietz (Curate)
on Sep 15, 2004 at 16:17 UTC ( #391230=note: print w/ replies, xml ) Need Help??


in reply to Re^3: IP Filtering RegEx needed
in thread IP Filtering RegEx needed

My above code is absolute nonsense and was just a quick hack
This should do it now on the specified ranges:

my $regex = qr/ ( 123\.145\.14[6-9]\.2 # match first specified range | # or # second specified range: 135\.168\. # <= first 2 octets (?: # 3rd octet: 1 (?: 0[0-9]|1[0-5] ) # 100 - 109 or 110 - 115 | # or [1-9][0-9] # 10 - 99 ) \. # 4th octet: (?: (?:1[01][0-9]|12[0-5]) # 100 - 119 or 120 - 125 | # or [0-9][0-9]? # 0 - 99 ) $ # end of string ) /ox;

I'm all puzzled now!

Dietz


Comment on Re^4: IP Filtering RegEx needed
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://391230]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2015-07-06 00:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls