Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re: RegEx revision needed

by Wonko the sane (Deacon)
on Oct 09, 2003 at 13:48 UTC ( #297911=note: print w/ replies, xml ) Need Help??

in reply to RegEx revision needed

The entries you are missing in your output seem to be the numbers denoted by 'SW:'.
Neither of your regexes attempt to match for this at all. The 'SW;'
numbers also seem to have a unique trait that spaces are allowed as part
of the data. 'SW: 1.00.00 S'

The following is a modification of your loop that gives the output you specified.

while (<DATA>) { push @array, $1 if ( /Version:?\s*([^\s,]+)/i ); push @array, $1 if ( /SW:?\s*([^\n\r]+)/i ); }
:!./ $VAR1 = '12.2(15)T8,'; $VAR2 = ''; $VAR3 = ''; $VAR4 = '6.3(7)'; $VAR5 = ''; $VAR6 = ''; $VAR7 = 'E5.8.0.3'; $VAR8 = '1.00.00 S'; $VAR9 = '12.0(14)';
Hope that helps.


Comment on Re: RegEx revision needed
Select or Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://297911]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (11)
As of 2015-07-06 08:19 GMT
Find Nodes?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...

    Results (70 votes), past polls