develooper Front page | perl.beginners | Postings from March 2012

multiple pattern matching

Thread Next
From:
Sunita.Pradhan
Date:
March 8, 2012 09:03
Subject:
multiple pattern matching
Message ID:
3A046B8D0B71BD4790EA3FB35CF40CE1152E957902@MX34A.corp.emc.com
Hi All

I have one output of one my command like :

$output = "Step 155 of 171 steps.....................................Executing.
    Step 168 of 171 steps.....................................Executing.
    Step 171 of 171 steps.....................................Executing.
    Local:  COMMIT............................................Done.

      New symdev:  2552
      New symdev:  2553
    Terminating the configuration change session..............Done." ;

I need to get those numbers like 2552 , 2553 .

I am applying following patter matching logic but it does not get me the  1st number (2552) .

@devs = $output =~ m/New symdev:\s*([0-9A-Fa-f]{4})/gis;
                        print $output,"\n";
                        print "Devices >>>> @devs <<<<<<<<<\n";


Could you please check what is going  wrong in  the above lines ?


Thanks
Sunita


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