You said that "It will mistake an IP address like 199.92.100.35.100 as a valid IP." The code I'm looking at that you wrote is like this:
IP : /[0-9]+.[0-9]+.[0-9]+.[0-9]/
I have to assume that the part there which looks like an RE is, indeed, a Perl-like regular expression. That being the case, your first problem is that "." has special meaning in an RE: It matches anything except the newline character. So [0-9]+. means match one or more numeric digits followed by any character. Well, that's probably not what you really want. So at minimum, escape those dot characters within the RE: [0-9]+\.
The next thing is that your RE isn't rejecting items that contain MORE than what you're trying to match. The Owls book (O'Reilly: Mastering Regular Expressions, by Friedl) presents the following regexp for matching IP addresses:
/^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]? +\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])$/
Note: I added the $ to the end of the RE so that you're not passing strings that contain anything after the IP address. That may or may not be necessary in your case. Hopefully that will be robust enough to help.
Dave
In reply to Re: TNSNAMES.ORA and Recdescent
by davido
in thread TNSNAMES.ORA and Recdescent
by jmr4096
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |