in reply to Re^3: Getting regular expression right
in thread Getting regular expression right
It's the character class inside the second last memory parentheses:[mellimik@localhost cgi-bin]$ perl -cw formCreator.pl Scalar found where operator expected at formCreator.pl line 286, near +"?:\|(.*))?$/" (Missing operator before $/?) syntax error at formCreator.pl line 286, near "[^" formCreator.pl had compilation errors.
Should be like this:if (/$_[0] =~ /^([^:]+):([^|]+)(?:\|(.*))?$/ || $_[0] =~ /^([^|)+)\|(.*)$/) {
if (/$_[0] =~ /^([^:]+):([^|]+)(?:\|(.*))?$/ || $_[0] =~ /^([^|])+)\|(.*)$/) {
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Getting regular expression right
by Anonymous Monk on Feb 15, 2005 at 13:08 UTC |