in reply to Nested Quantifier Headaches

Since the + sign is special inside regexes, you'll need to escape it with a backslash. Since the + sign is inside a variable you're using in your regex, you can use the special \Q and \E tokens to escape any special characters in the variable, like this:
if ( grep {/^\Q$ITEM\E$/} @ARRAY ) {

A more extensive explanation of \Q and \E can be found in the perlre documentation.

Update: Just realized that you may be better off not even using a regex for this. Since you're looking for an exact string match, you can also use eq, like this:

if ( grep {$_ eq $ITEM} @ARRAY ) {

-- Mike

--
just,my${.02}

Replies are listed 'Best First'.
Re: Re: Nested Quantifier Headaches
by keywest (Initiate) on Jun 05, 2003 at 19:06 UTC
    I used the /Q and the /E, this worked well. Thank you for the input and fast response.

    Kevin