Hi

I have a config file that can have three formats:
"[alpha] [alpha]", "[alpha]: [alpha]" or "[alpha] *[alpha]"

So I made 3 regexp to check each variation:
$line1 =~ /\s*([\w-_\.]+)\s+([\w-_\.]+)/;
$line2 =~ /\s*([\w-_\.]+):\s*([\w-_\.]+)/;
$line3 =~ /\s*([\w-_\.]+)\s+\*([\w-_\.]+)/;

the problem is that $1 and $2 keep the falues of the previous match. That means that I can't see if a match was foud unless I have to test it for each line.
Is there a way to clear the matched subexpressions of the $1...$9 variables or do I have to check each line to see what test applies?


Thanks in advance,
Americo Albuquerque



_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to