in reply to Strange regexp problem
(note the square bracket) and end like this:s/(.{$len}[...
which means that all those backslashes, parens, curlies with digits, and vertical-bar alternations are actually inside a character class. (If you don't understand what that means, you need to spend some time with perlretut and perlre.)...])/$1<wbr>/mgi;
To make matters worse, you even seem to be trying to use embedded square brackets, which really cannot be right -- that in itself might not be a syntax error, but it simply will not work. (The PM formatting logic turned the square brackets surrounding "a-z" into an anchor tag, which wouldn't happen if you used code tags around the code.)
So, the regex in its original form is trash. Start over. What are you really trying to accomplish? What is the input data? What is the intended output?
|
|---|