I've got a script I'm using to search through a list of Wikipedia
article titles to find ones that match certain patterns.
As-written, if you run it and supply '.*target.*' on standard input,
it will process my test file in 125 seconds. Make any of the changes
mentioned in the comments, and the t
try this:
print "Match\n" if($target =~ /^$regex$/*o*);
only compile regex only once
On Fri, Oct 31, 2008 at 2:54 PM, Mark Wagner <[EMAIL PROTECTED]> wrote:
> I've got a script I'm using to search through a list of Wikipedia
> article titles to find ones that match certain patterns.
>
> As-
On Fri, Oct 31, 2008 at 2:54 PM, Mark Wagner <[EMAIL PROTECTED]> wrote:
> I've got a script I'm using to search through a list of Wikipedia
> article titles to find ones that match certain patterns.
>
> As-written, if you run it and supply '.*target.*' on standard input,
> it will process my test
I probably should have specified: the program in my first email is a
minimal sample that can reproduce the problem. The original program
is significantly longer and more complex.
On Fri, Oct 31, 2008 at 14:38, Li, Jialin <[EMAIL PROTECTED]> wrote:
>
> print "Match\n" if($target =~ /^$regex$/o);
Mark Wagner wrote:
I've got a script I'm using to search through a list of Wikipedia
article titles to find ones that match certain patterns.
As-written, if you run it and supply '.*target.*' on standard input,
it will process my test file in 125 seconds.
'.*target.*' is inefficient because th
From: "Mark Wagner" <[EMAIL PROTECTED]>
> I've got a script I'm using to search through a list of Wikipedia
> article titles to find ones that match certain patterns.
>
> As-written, if you run it and supply '.*target.*' on standard input,
> it will process my test file in 125 seconds. Make any o
Jenda Krynicky schreef:
> The thing is that if you use
>
> $something =~ /^$regex$/;
>
> in a loop, Perl has to copile the regular expression for each
> iteration. Because it can't know whether the $regex variable
> is still the same or not.
(assuming C)
I wouldn't directly know how to test it,