in reply to Simple Regex Question
my $area = $tmp; # anchor the pattern at the start of the line using ^ # then look for the third clump of characters and pick everything +through up to the hyphen. # the ? turns off greedy matching, so you do not get messed up by +duplicate occurrences of -dpt on the same line. $area =~ s/^.*\s+.*\s+(.*?)-dpt/\1/; return $area;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Simple Regex Question
by KM (Priest) on Jan 30, 2001 at 01:35 UTC | |
by sierrathedog04 (Hermit) on Jan 30, 2001 at 02:52 UTC | |
by KM (Priest) on Jan 30, 2001 at 03:03 UTC | |
by sierrathedog04 (Hermit) on Jan 30, 2001 at 07:35 UTC |