in reply to RegEx advice needed

I made some adjustments and corrected two of the three with:
push @array, $1 if ( /Version:?\s*([^\s;,\n\r]+)/i ); push @array, $1 if ( /SW:?\s*$|SW_REV:?\s*([^\s;,\n\r]+)/ ); push @array, $1 if ( /Rev\s*$|\s+Revision:?\s*([^\s;,\n\r]+)/i ); # OUTPUT IS: # FW: rdtg7.0.4.7 # FW: 0 # FW: CG4D_05.3.02
It's still finding Hardware version first!....any thoughts?

Replies are listed 'Best First'.
Re: Re: RegEx advice needed
by monktim (Friar) on Oct 23, 2003 at 20:23 UTC
    This is getting ugly. This uses your code to work for the given example. I don't know if this is what you really want though.
    push @array, $1 if ( /(?<!Hardware)(?=\s+Version:?\s*([^\s;,\n\r]+))/i + );