in reply to regex help humbly sought
#!/usr/bin/perl
use strict;
my $sw;
while (<DATA>) {
if ($_ =~ /BeginEditable/) {$sw="on";}
elsif ($_ =~ /EndEditable/) {$sw="off";}
elsif ($sw eq "on") {print "$_"}
}
__DATA__
psycho
alpha
(!_-%BeginEditable$$) nb. the "html" is irrelevent
disco
mater
tangle
(^-EndEditables)
glyph
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex help humbly sought
by mr_mischief (Monsignor) on Mar 06, 2008 at 05:45 UTC | |
|
Re^2: regex help humbly sought
by ikegami (Patriarch) on Mar 06, 2008 at 15:20 UTC |