Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 14578 invoked from network); 2 Aug 2005 14:32:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Aug 2005 14:32:37 -0000 Received: (qmail 47116 invoked by uid 500); 2 Aug 2005 14:32:29 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 47075 invoked by uid 500); 2 Aug 2005 14:32:29 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 47062 invoked by uid 99); 2 Aug 2005 14:32:29 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2005 07:32:28 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of antuser@gmail.com designates 64.233.184.207 as permitted sender) Received: from [64.233.184.207] (HELO wproxy.gmail.com) (64.233.184.207) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2005 07:32:20 -0700 Received: by wproxy.gmail.com with SMTP id 50so1239420wri for ; Tue, 02 Aug 2005 07:32:27 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rAXg8VSRhqqcw82etmlFbZzD5hveW9tr6y9EuAbjreP/1hi9MSaR/JIyxGWYVm9D7plEzIFTOFDsyr4AydacOmeGMovBfxLg8ObQQXW1kdHj4WBOVC6bOLHk/Glji9MAIj8o7aNsxy79Ym9IoMbkiEtNK7YmaAw/DBHcLO2A6ZQ= Received: by 10.54.68.4 with SMTP id q4mr3783238wra; Tue, 02 Aug 2005 07:32:27 -0700 (PDT) Received: by 10.54.15.39 with HTTP; Tue, 2 Aug 2005 07:32:27 -0700 (PDT) Message-ID: Date: Tue, 2 Aug 2005 16:32:27 +0200 From: Patrick Martin Reply-To: Patrick Martin To: Ant Users List Subject: Re: regular expression help+tokens instead of words In-Reply-To: <35F56E214D71814B80E64DCA5B770E520B2158@EMEXM0102.dir.svc.accenture.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <35F56E214D71814B80E64DCA5B770E520B2158@EMEXM0102.dir.svc.accenture.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi, You could try to replace the blank character by ' myPrefix' (not the blank before myPrefix). Patrick Martin On 8/2/05, hind.lwahhabi@accenture.com wrote: > thanks Ahmed it works for the sample string i provided. > My question is how can you avoid special characters e.g instead of Foo Ba= r blabla , you have: > input string=3Dfoo/bar.ext foo/some1.ext. > The goal is to match the tokens separated by blank space and not words. >=20 > Thanks for any help! >=20 >=20 > Hind Lwahhabi. >=20 >=20 >=20 >=20 > -----Original Message----- > From: Basel Ahmed [mailto:Basel.Ahmed@fds.com] > Sent: Tue 8/2/2005 3:42 PM > To: Ant Users List > Cc: user@ant.apache.org > Subject: RE: regular expression help >=20 > Here's a code snippet that does what you'd like to do with > . >=20 > input=3D"Foo Bar Blah Blah" > regexp=3D"([A-Za-z]+)" > replace=3D"myPrefix\1" > global=3D"true" > casesensitive=3D"false" /> >=20 >=20 > The result is: > [echo] Regular expression is: myPrefixFoo myPrefixFoo myPrefixFoo > myPrefixFoo >=20 > Basel Ahmed > Federated Systems Group > Site Build & Launch (Duluth) > basel.ahmed@fds.com > 678-474-3203 >=20 >=20 > "Time is the coin of your life. It is the only coin you have and only you > can determine how it will be spent. Be careful, lest you let others spend > it for you." --Rod McKuen >=20 >=20 > "Live as if your were to die tomorrow. Learn as if you were to live > forever. " -- Mahatma Gandhi >=20 >=20 > "Don't argue for other people's weaknesses. Don't argue for your own. Whe= n > you make a mistake, admit it, correct it, and learn from it--immediately.= " > -- Stephen Covey >=20 >=20 >=20 > centure.com> > T= o > 08/02/2005 09:21 > AM c= c >=20 > Subjec= t > Please respond to RE: regular expression help > "Ant Users List" > org> >=20 >=20 >=20 >=20 >=20 >=20 >=20 >=20 > Do you mean: > > But then all the words would be replaced by the prefix , no? > Forgive me i ama beginner in regular expressions:) >=20 >=20 > Hind Lwahhabi. > Accenture Belgium - Financial Services & Insurance > Koningstraat 145 Rue Royale, B-1000 Brussels, Belgium > mobile: +32 499567544 > phone: + 32 2 226 75 44 > E-mail:hind.lwahhabi@accenture.com >=20 >=20 >=20 > -----Original Message----- > From: James Fuller [mailto:jim.fuller@ruminate.co.uk] > Sent: Tue 8/2/2005 3:11 PM > To: Ant Users List > Subject: Re: regular expression help >=20 > hind.lwahhabi@accenture.com wrote: >=20 > >Hello guys; > >I would like some help for the following. > >Using how would you perform the following: > > > >input string=3D"Foo Bar Jeff Blabla" > >replacing prefix=3D"myPrefix" > >result string=3D"myPrefixFoo myPrefixBar myPrefixJeff myPrefixBlabla" > > > > > \w* should match every word or u could use the ^ method. >=20 >=20 > I normally use something like this to match words > /\b([A-Za-z]+)\b >=20 >=20 > gl, Jim Fuller >=20 >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org >=20 >=20 >=20 >=20 > This message is for the designated recipient only and may contain > privileged, proprietary, or otherwise private information. If you have > received it in error, please notify the sender immediately and delete the > original. Any other use of the email by you is prohibited. >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org >=20 >=20 >=20 >=20 > This message is for the designated recipient only and may contain privile= ged, proprietary, or otherwise private information. If you have received i= t in error, please notify the sender immediately and delete the original. = Any other use of the email by you is prohibited. >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org >=20 > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org