in reply to How do I extract all text around a keyword between two symbols?
This works assuming you want quick and dirty rather than using the elegant reliable Parser solution.
$string =<<'TEXT'; <tr>1 The last company to fail was ISTF with losses of $60M.</tr> <tr>2 The last company to fail was ITF with losses of $60M.</tr> <tr>3 The last company to fail wasISTF with losses of $60M.</tr> < tr>4 The last company to fail was ISTF with losses of $60M.</tr > TEXT print "Found $1\n" while $string =~ m|<\s*tr\s*>([^<]*\bISTF\b[^<]*)<\ +s*/tr\s*>|gi;
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do I extract all text around a keyword between two symbols?
by Hofmator (Curate) on Aug 01, 2001 at 16:31 UTC |