RE: Stripping words from a string

2002-02-21 Thread Jeff 'japhy' Pinyan
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

RE: Stripping words from a string

2002-02-21 Thread Mark Anderson
>> 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'

RE: Stripping words from a string

2002-02-21 Thread Jonathan E. Paton
--- 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

Re: Stripping words from a string

2002-02-19 Thread Tanton Gibbs
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

RE: Stripping words from a string

2002-02-19 Thread Wagner-David
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

RE: Stripping words from a string

2002-02-19 Thread Wagner-David
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-