Ken Fox <[EMAIL PROTECTED]> wrote:
> I cannot figure out how to set a variable based on which
> regexp matched --
If you're using a relatively new version of Perl (5.6.1 may be
required), the special variables @- and @+ may be useful. They
are arrays holding the start and end positions of the
On Wed, 27 Mar 2002, Ken Fox wrote:
>
> Hi folks -- not 100% sure this is the rigt place so point me right if I'm
> wrong
>
> I'm trying to do a fast search through an extremely large file and what I
> want to do is to execute code (or at least set a variable to a value) based
> on which regular
Ken,
The following code used after your search might be useful:
# A regex debug structure.
use English;
if (defined $PREMATCH) {print("PREMATCH = $PREMATCH\n")}
if (defined $MATCH) {print("MATCH = $MATCH\n")}
if (defined $POSTMATCH) {print("POSTMATCH = $PREMATCH\n")
ot;Ken Fox" <[EMAIL PROTECTED]>
To: "Perl-Win32-Users" <[EMAIL PROTECTED]>
Sent: Wednesday, March 27, 2002 15:28
Subject: RE: deterministic regexps (missed something)
> Folks -
>
> $check is not set following the line
> if ($line=~ =~/$meg
I had thought of that
too) and grab $1 for the match and do a reverse lookup again.
-- Thanks, ken
-Original Message-
From: Ken Fox [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 27, 2002 4:19 PM
To: Perl-Win32-Users
Subject: RE: deterministic regexps
No I am reading the regexp in as a