in reply to Re: Re: Simple Regex Question
in thread Simple Regex Question
My proposed solution is:
use strict; my $row1 = "newjersey-ab1.net agg nj1-dpta1 net 10"; $row1 =~ s/^.+\s+.+\s+(.+)-dpt.*$/\1/; print $row1;
As far as looking at the other answers, yes I look at them. If my approach differs from the other answers then I like to throw it out there and see what people say.
I agree with you that my answer may be inefficient; I really only starting doing Perl seriously last year. My question to anyone who cares to answer is, why is it inefficient? And is this inefficiency lost in the noise of overall execution times, or would it be a problem in real-life?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Simple Regex Question
by KM (Priest) on Jan 30, 2001 at 03:03 UTC | |
by sierrathedog04 (Hermit) on Jan 30, 2001 at 07:35 UTC |