Eric Rodriguez wrote: > Hi, > > I'm having trouble with the check invalid_ip subroutine in the > RelayEval.pm. > See > http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/RelayEval.pm?view=log&r1=451385&pathrev=451385 > <http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/RelayEval.pm?view=log&r1=451385&pathrev=451385> > > After a couple test, it seems that 193.X.X.X and 194.X.X.X ip's are > not "valid" with respect to the regexp. > Is this a bug? or am I wrong about the test? > > I used http://www.fileformat.info/tool/regex.htm with > RegExp: > (?:[01257]|(?!127.0.0.)127|22[3-9]|2[3-9]\d|[12]\d{3,}|[3-9]\d\d+)\.\d+\.\d+\.\d+ > Tests: > 127.0.0.1 > 192.168.1.1 > 87.248.121.75 > 193.1.1.1 > 194.1.1.1 > > > Could someone explain me which ip are "valid" according to this test ? > Thanks > > Eric Rodriguez Using the above tool I get results telling me that 193.1.1.1 and 194.1.1.1 do NOT match, and therefore are valid IPs.
Test Target String matches() replaceFirst() replaceAll() lookingAt() find() group(0) 1 193.1.1.1 *No* 193.1.1.1 193.1.1.1 No No 2 194.1.1.1 *No* 194.1.1.1 194.1.1.1 No No In fact, NONE of your test strings match the regex. But 127.1.1.1, correctly, does.