in reply to Bug in script, regex help req extreme urgent
Hello sid.verycool, and welcome to the Monastery!
Please note that when a regular expression is assigned to a string prior to its use in a match, the string should be quoted using Perl’s qr// operator. That is, a line such as:
my $match = "(?<=module )$ARGV[2].*?([\\(;])";
is better written:
my $match = qr/(?<=module )$ARGV[2].*?([\\(;])/;
See Regexp Quote Like Operators in perlop for the advantages of using this form of quoting.
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Bug in script, regex help req extreme urgent
by sid.verycool (Novice) on Mar 10, 2013 at 05:18 UTC | |
by Athanasius (Archbishop) on Mar 10, 2013 at 05:48 UTC | |
by sid.verycool (Novice) on Mar 21, 2013 at 03:42 UTC | |
by sid.verycool (Novice) on Mar 10, 2013 at 07:22 UTC | |
by jms53 (Monk) on Mar 10, 2013 at 13:51 UTC |