TASdvlper has asked for the wisdom of the Perl Monks concerning the following question:
In the code below, I'm trying to set up two different array, (@testtype and @testsuite), well the problem is "Base Functionality" is ending up in the testtype array and not the testsuite array (it's matching 'Functionality' in the regexp). I want these to be exact matches and not partial matches.
I've tried using "^ and $" in the parenthesis and outside but nothing seems to work. I'm sure this is a easy fix, I just can't seem to get a handle on it.
Thank in advance.
if ( $q->param($_) ne "" ) { if ( /(Smoke|Integration|Functional|Non-Functional|Regressio +n|New)/ ) { push (@testtype, $param) if ( $q->param($_) eq "yes" ); } elsif ( /(Base Functionality|\(4\) DPC|Boot Support|Clones|L +ow Priority|Clusters|Data Mobility|Host Based Applications|Performanc +e|Scalability)/ ) { push (@testsuite, $param) if ( $q->param($_) eq "yes" ); } else { $myhash{$param} = $q->param($_); $myhash{$param} =~ s/^\s+|\s+$//g; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regular Expression Question - Having problems with anchors
by sauoq (Abbot) on Sep 30, 2005 at 18:30 UTC | |
|
Re^2: Regular Expression Question - Having problems with anchors
by philcrow (Priest) on Sep 30, 2005 at 18:27 UTC | |
by sauoq (Abbot) on Sep 30, 2005 at 21:59 UTC |