Levan has asked for the wisdom of the Perl Monks concerning the following question:
I am using a simple regular expression to match some text and the regular expression is something like this:
if ($text =~ /.*$stub.*/s) { #do something }
As you can see that I am using a scalar as a matching target, this is where the problem comes in
The problem is that this scalar $stub is volatile and it also contains a little bracket:
#volatile scalar $stub = 'bob(scalar)';
So how do I actually get the regular expression to work?? Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching brackets in Regular Expression
by thospel (Hermit) on Nov 21, 2003 at 06:45 UTC | |
by melora (Scribe) on Nov 21, 2003 at 14:24 UTC | |
|
Re: Matching brackets in Regular Expression
by Roger (Parson) on Nov 21, 2003 at 01:28 UTC | |
|
Re: Matching brackets in Regular Expression
by Hagbone (Monk) on Nov 21, 2003 at 02:21 UTC | |
|
Re: Matching brackets in Regular Expression
by RolandGunslinger (Curate) on Nov 21, 2003 at 15:15 UTC | |
by jweed (Chaplain) on Nov 21, 2003 at 18:28 UTC | |
by qq (Hermit) on Nov 21, 2003 at 22:54 UTC |