|
|
| laziness, impatience, and hubris | |
| PerlMonks |
Escaping parentheses in regexpsby Tanalis (Curate) |
| on Jan 22, 2003 at 14:43 UTC ( #229024=perlquestion: print w/ replies, xml ) | Need Help?? |
|
Tanalis has asked for the
wisdom of the Perl Monks concerning the following question:
Monks,
I have a set of strings (pulled from a DB) that I'm concatenating into one string, using the following code: Simple enough, and it does the job, except where the imported strings contain any form of parentheses, for example () or [], where the string always gets appended regardless of whether it's already there or not. I'm trying to find a way to escape the strings that are being matched against - does anyone know of a way to do this? I've tried running the string through qq, and tried using /"$string"/ to match, with no success .. Thanks in advance for your help.
Back to
Seekers of Perl Wisdom
|
|