in reply to Strange regexp problem
I'd suggest to write the main part of the regex outside the string eval, then you don't have to care about quoting.
my $main_re = qr/[^&#?(\w{2,7});|\\xeb|\\x(\w{2})|\\\\x(\w{2})|\\(\w{2 +,7})|\\'|\\\'|\'|\\"|\\"|\\"|\\\\|\w{5}|a-z|<(.*)>|<\/?.*>]/
Then you can interpolate $main_re into the regex.
BTW your regex is absolutely horrible to read, you should use the /e modifier and insert whitespaces, line breaks and comment.
Update: You seem to have alternatives (|) inside a (negated) char class - that makes no sense at all. Or did the markup go astray?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Strange regexp problem
by akho (Hermit) on Aug 28, 2007 at 09:19 UTC | |
by moritz (Cardinal) on Aug 28, 2007 at 09:37 UTC |