Hi

"Dan" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> OK, that worked fine, until a \ character was introduced into the variable
> which contains the information to be removed, for example, #blah\
>
> I tried both john's & rob's methods, both crashed the service. Any clues?
> Cheers.
>

Hmm. There's something going on here that we don't know about. My guess is
you're using something like:

    $word = '#blah\\';
    s/(\s|^)$word(?=\s|$)//;

where the problem would be that your variable is simply being copied
verbatim into the string, and so escaping the character immediately
following. Like this:

    s/(\s|^)#blah\(?=\s|$)//;

which clearly changes the meaning of the following look-ahead expression (?=
... ). Try:

    s/(\s|^)\Q$word\E(?=\s|$)//;

which quotes the entire contents of your variable, which can then contain
any charatcers with impunity.

If this isn't what you're doing, let us know.

Cheers,

Rob









-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to