That's a cool regex, but IP addresses can be just a little more complicated than that. There's a bad old standard you might need to take into account:

Just like in IPv6, you can omit octets in the middle if they are zero, for example:

127.1 means 127.0.0.1
10.40.30 means 10.40.0.30

And it gets worse. 192.168.288 is a perfectly legal IP address, most people would write it as 192.168.1.32. Or 10.258 will get you to 10.0.1.2. The rule seems to be that the last decimal number in the address is first spread out into octets, then the remaining octets are dropped in from left to right, starting leftmost. This is the source of the classic trick of getting around IP and name based web filters by entering the 'one huge decimal number' version of the IP address in a browser (I don't think it works on modern browsers that try to be smart about DNS lookups.)

Deranged? Yes. But they're out there, and they work on all NT-based OSs and every *nix I've been able to try it on.

If the underlying system (Oracle, I presume) only supports sane IP addresses, you're cool. I don't know if there would be a way to write a regex for these odd cases. Monks?

--
Spring: Forces, Coiled Again!

In reply to Re: Re: TNSNAMES.ORA and Recdescent by paulbort
in thread TNSNAMES.ORA and Recdescent by jmr4096

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.