in reply to Stuck with RegEx (Parsing whois output)
Update: $flag reset. Thanks to si_lenceuse strict; my $flag = "n"; open FH, '<', 'filename'; foreach (<FH>) { $flag = "n" if /\{section\d+\}/; $flag = "y" if /\{section2\}/; if ($flag =~ /[yY]/) { print $1 if /key2: (.*)$/; } } close FH;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Stuck with RegEx
by si_lence (Deacon) on Sep 28, 2004 at 09:18 UTC | |
|
Re^2: Stuck with RegEx (Parsing whois output)
by marsch (Initiate) on Sep 28, 2004 at 09:13 UTC |