develooper Front page | perl.beginners | Postings from January 2002

RE:Parsing and regexp

Thread Next
From:
Jorge Goncalvez
Date:
January 9, 2002 02:55
Subject:
RE:Parsing and regexp
Message ID:
200201091054.LAA15391@cabs40.col.bsf.alcatel.fr
Hi, I made a parsing of a file which contains :
this:
Adresse IP. . . . . . . . . : 155.132.48.23

like this to obtain the Ip adress.

if ($_ =~/Adresse IP/) {
            $_ =~ s/.+://;
            
            $Subnet=$_;
            
            push @IPREAL, $_;
            
            $_=~ s/(\d+\.\d+\.\d+)\.\d+/$1.0/;
            
            push @IP, $_;
            
It works but my problem is that parsing works only in french files, but I wanted 
to make it working in another language like for exemple English.
I have 
IP Address. . . . . . . . . : 155.132.114.77 

How can I improve my regexp   if ($_ =~/Adresse IP/) to check the IP address 
indepentmently of the language (I know that the searched string contains always 
"IP" )

Thanks        
            
            


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About