in reply to Regexing a block of text in between patterns
You could split on 'Sidenote':
... my $filename = 'C:\letters.txt'; open my $fh, '<', $filename or die "Can't read $filename, $!"; my $text = do { local $/; <$fh> }; close $fh; my @sidenotes = split /(?=\[Sidenote:)/, $text; my $div_output = join "\n", map "<div>$_</div>", @sidenotes; print $div_output; ...
Regards
mwa
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regexing a block of text in between patterns
by CountZero (Bishop) on Mar 10, 2009 at 17:15 UTC | |
by mwah (Hermit) on Mar 10, 2009 at 18:03 UTC | |
by CountZero (Bishop) on Mar 10, 2009 at 19:42 UTC |