in reply to Regex Error

I've already tried the first way (I also tried $after =~ $scur).

And I don't want a literal dollar sign . . . the contents of $scur could change.

?

Replies are listed 'Best First'.
Re: Re: Regex Error
by pbeckingham (Parson) on May 20, 2004 at 00:57 UTC

    If you've tried the first way and it didn't work, then I suspect that $after and/or $scur do not contain quite the data you expect. Can you confirm this? Are there newlines in either? Is case an issue? How about using:

    my $pattern = "\\" . $cur; if ($after =~ /$pattern/) { do something; }