#!/bin/perl -w use strict; # slurp it up $/=''; my $slurp = <DATA>; # one nice string might as well split it # adding a little whitespace gobble and case protection my @stuff = split(/\s*<\s*[Hh][Rr]\s*>\s*/,$slurp); # and spit it out foreach (@stuff) { print $_,"\n"; } __DATA__ <HR> 1 is good<BR> useless data<BR> useless data<BR> useless data<BR> useless data<BR> <HR> 2 is not good <BR> useless data<BR> useless data<BR> useless data<BR> useless data<BR> <HR> 3 is good<BR> useless data<BR> useless data<BR> useless data<BR> useless data<BR> <HR> 4 is not good <BR> useless data<BR> useless data<BR> useless data<BR> useless data<BR> <HR>
mitd-Made in the Dark
'Interactive! Paper tape is interactive!
If you don't believe me I can show
you my paper cut scars!'
In reply to Re: parsing with regex
by mitd
in thread parsing with regex
by 2501
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |