On Feb 21, Mark Anderson said:
>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.
Well, you have to define the word-removal. If you're removing the word at
the beginnin
>> 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'
--- Wagner-David <[EMAIL PROTECTED]> wrote:
> 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.
Jonathan Paton
__
Do
AIL PROTECTED]>
To: "Wagner-David" <[EMAIL PROTECTED]>; "'Daniel Falkenberg'"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, February 20, 2002 1:22 AM
Subject: RE: Stripping words from a string
> Though s(world .. worked w/o /, it sho
ubject: RE: Stripping words from a string
Put the string in $_ and with
s(world |how )//gi;
If you don't take out a space then you get a couple of spaces:
Output(no space part of check (world|how):
Hello are you?
Output(w/ space part of check above):
Hello
Put the string in $_ and with
s(world |how )//gi;
If you don't take out a space then you get a couple of spaces:
Output(no space part of check (world|how):
Hello are you?
Output(w/ space part of check above):
Hello are you?
Wags ;)
-Original Message-