in reply to Re: Problems with a regex?
in thread Problems with a regex?
To /^\Q$stack\E$/ (emphasis on the \E).
And to the OP, note that your first RE can be simplified:
#if ($line =~ m/set\sservice\s(\".+\").?/) { if ($line =~ m/set\sservice\s(".+")/) {
No need to escape quotes; nor to match beyond what you are interested in. (I often see REs with a useless .* at the end.)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Problems with a regex?
by BrowserUk (Patriarch) on Aug 14, 2012 at 16:05 UTC | |
by hbm (Hermit) on Aug 14, 2012 at 16:38 UTC | |
by BrowserUk (Patriarch) on Aug 14, 2012 at 18:06 UTC |