The input is as follow's#!/usr/bin/perl -w use Geo::IP; use strict; Xchat::register( "Whois Addon", "0.5", "A Geop and ip resolver for irc +op's for the whois command", "" ); Xchat::hook_server('378', \&parse_line); my $servertabname = "Station51"; sub parse_line { my ($line); $line = shift (@_); Xchat::print("test1",,$servertabname); if ($line =~ m/:.+\@.+\s([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0- +9]{1,3})/){ Xchat::print("test2",,$servertabname); my $ip = $1 ; Xchat::print("Is From ".countryname($ip)."",,$servertabname); } Xchat::print("test3",,$servertabname); } sub countryname{ my ($ip) =@_ ; my $gi = Geo::IP->open("/home/m/Desktop/Test Stuff/GeoIP.dat", GEOIP_S +TANDARD); return $gi->country_name_by_addr($ip); }
how ever with the print statements the out put israndom.ircserv.net 378 ircop Blueink :is connecting from *@78.273.80.2 +3 78.273.80.23
Which tell's me the regex is not being accepted does any one have any idea why this is ??? Thanks -- Blueinktest1 test3
In reply to Frustration With regex by BlueInk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |