>> Though s(world .. worked w/o /, it should be written
>> s/(world | how )//gi;
>
> s/\b(world|how)\b//gi;
>
> The \b is a word boundary, which is going to work as
> expected more frequently.

The first example doesn't work if the word is followed by a punctuation
mark.
The second example doesn't get rid of the space, which is fine for HTML, but
not for other uses.

I would suggest
$string =~ s/ ?\b(world|how)\b//gi;
but I'd love to hear further suggestions.

                                        /\/\ark


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

Reply via email to