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[0-9]|12[0-5]) # 100 - 119 or 120 - 125
| # or
[0-9][0-9]? # 0 - 99
$ # end of string
I'm all puzzled now!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||