Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

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!


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://391230]
[ambrus]: level where people can more easily write as good mathematical papers in them as the people who write bad LaTeX papers usually write.
[ambrus]: Yes, for like the first twenty of its years, TeX was basically the only system that allowed you to write decent maths papers, and C++ and PHP were programming languages that sucked, etc. But times change and people have to accept that.
Discipulus bad people + good tool < normal people + decent tool
[Discipulus]: php does not suck anymore?
[ambrus]: Discipulus: I'm not sure, but it certainly doesn't suck as much as it's used to. it's like C++, it sucks because people still recursively learn from twenty year old PHP examples,
[ambrus]: and they try to use the obsolete features that PHP has to support only for compatibility with old scripts. C++ and PHP both have the problem that people can't forget the past, because when they google "PHP" plus the problme they want to solve, they find b
[ambrus]: ad code examples.
[ambrus]: I'm not trying to recommend PHP, but I think it has way too bad a name because of its past.
[ambrus]: This is different from MS Word, which was already a good editor in the pre-unicode days (in word for windows versions 2 and 6, which ran on windows 3 but also on windows 95), only it wasn't trying to solve the task of writing maths papers back then.
[Discipulus]: ah ok, sounds reasonable; with no fear: Perl all life long

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-09-26 11:08 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (293 votes). Check out past polls.