in reply to Help with Multiple line RegEx
You may find this helpfull if your real data is of modest size:
use strict; use warnings 'all'; my $str = do {local $/ = undef; <DATA>}; my @Rec = $str =~ /-+\s+show switchname\s+-+[^\w]+(\w+)/ig; print "$_\n" for @Rec;
__DATA__ show tech-support details -------------------- show switchname ------------------ CCC217_ANG_GREEN ****************************************************************** show tech-support details -------------------- show switchname ------------------ CCC218_ANG_GREEN ****************************************************************** show tech-support details -------------------- show switchname ------------------ CCC219_ANG_GREEN ****************************************************************** show tech-support details -------------------- show switchname ------------------ CCC220_ANG_GREEN ******************************************************************
Prints:
CCC217_ANG_GREEN CCC218_ANG_GREEN CCC219_ANG_GREEN CCC220_ANG_GREEN
Update: Silly programmer mixed input and output seperators :(
|
|---|