in reply to RegEx advice needed

I deleted your original regexen and write my own:

#!/usr/bin/perl use strict; use warnings; my @array = (); while (<DATA>) { if ( /Version:\s*(\S+),/ ) { push ( @array, $1 ), next; } if ( /Software version:\s*(\S+)/ ) { push ( @array, $1 ), next; } if ( /SW_REV:\s*(\S+);/ ) { push ( @array, $1 ), next; } } foreach (@array) { $_ =~ s/Copyright//i; print "FW: $_\n"; } __DATA__ Company: Nuera Communications, Inc., ProductFamily: ORCA Series, Produ +ct: RDT-8, Version: rdtg7.0.4.7, HardwareRevision: A Motorola Corporation SB4100E Cable Modem: Hardware version: 0; OS: VxW ++orks 5.3.1; Software version: 4.1.4p <<HW_REV: 0; VENDOR: Motorola; BOOTR: CG4D_05.3.02; SW_REV: CG4D_05.3. +02; MODEL: SBV4200>>OS: VxWorks 5.4
The code produces the output that you wanted:
[tab@fred dev]$ perl -w pm23-10-03.pl FW: rdtg7.0.4.7 FW: 4.1.4p FW: CG4D_05.3.02
but I skipped the alternative options with 'SW_REV' in the third regex that suggest you had to do some additional fiddling around.

I also did a next after finiding a match on the assumption that once you've found a match, it's a waste of time to try and find another match. This isn't too bad when you're dealing with 100 lines of data but begins to be a real problem when you have 1000000 lines of code and dozens of regexen.

--t. alex
Life is short: get busy!