in reply to Search all occurences of text delimited by START and END in a string
You can process your file simply line-by-line.
Or you may use HTML::Parser if your html files are not well formatted.#!/usr/bin/perl use strict; use warnings; use diagnostics; my $start = '<START>'; my $end = '<END>'; foreach (<DATA>) { chomp; print "$1\n" if /$start(.+)$end/; } __DATA__ <START>TEXT1<END> <various data> <START>TEXT2<END> <various data> <START>TEXT3<END>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Search all occurences of text delimited by START and END in a string
by kennethk (Abbot) on May 12, 2015 at 15:04 UTC |