From: Jeremy Tregunna Date: 2006-05-25T14:41:29+09:00 Subject: Re: Regexp to esclude substrings --Apple-Mail-22-577268708 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed On 25-May-06, at 1:24 AM, vincent wrote: > I'm trying to resolve a very simple problem, but I'm encountering some > issues. > > Input: "this is a string where you can find some words" > Output: [this, string, where, can, find, some, words] > > So I'm trying to eliminate ' is ', ' a ' and ' you ' from the string > (note the spaces, 'this' shouldn't be eliminated just because it > includes 'is'). > > I tried the following (and many others), but it doens't work: > my_string =3D input_string.gsub!(/\s+(is|a|you)\s+/i, my_string =3D input_string.gsub!(/\s+\b(is|a|you)\b\s+/i, ' ').split -- Jeremy Tregunna jtregunna@blurgle.ca "The proof is the proof that the proof has been proven and that's the =20= proof!" - Jean Chr=E9tien --Apple-Mail-22-577268708--