Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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.