Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 12991 invoked from network); 28 Nov 2006 06:30:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Nov 2006 06:30:53 -0000 Received: (qmail 75801 invoked by uid 500); 28 Nov 2006 06:31:00 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 74836 invoked by uid 500); 28 Nov 2006 06:30:57 -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 74824 invoked by uid 99); 28 Nov 2006 06:30:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Nov 2006 22:30:57 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [193.201.183.194] (HELO sscd0002.dmz.huk.de) (193.201.183.194) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Nov 2006 22:30:45 -0800 Received: from sscd0028.dmz.huk.de ([10.148.152.146]) by sscd0002.dmz.huk.de with Microsoft SMTPSVC(6.0.3790.1830); Tue, 28 Nov 2006 07:30:23 +0100 Received: by sscd0028.dmz.huk.de (Postfix, from userid 1) id 93E7B58070; Tue, 28 Nov 2006 07:30:59 +0100 (CET) Received: from sscd0002.dmz.huk.de (sscd0002.dmz.huk.de [10.148.152.132]) by sscd0028.dmz.huk.de (Postfix) with ESMTP id DF31158070 for ; Tue, 28 Nov 2006 07:30:58 +0100 (CET) Received: from sxf00002.lan.huk-coburg.de (unverified) by sscd0002.dmz.huk.de (HUK-COBURG Mailrelay2) with ESMTP id for ; Tue, 28 Nov 2006 07:30:23 +0100 Received: from VEX00120.lan.huk-coburg.de ([10.131.152.134]) by sxf00002.lan.huk-coburg.de with Microsoft SMTPSVC(6.0.3790.1830); Tue, 28 Nov 2006 07:30:22 +0100 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 Subject: RE: containsregex and concat Date: Tue, 28 Nov 2006 07:30:21 +0100 Message-ID: <1397E81F23832842BDD7B2D758D4B0B503256BBD@VEX00120.lan.huk-coburg.de> In-Reply-To: <456BC5B2.7040604@funnelback.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: containsregex and concat Thread-Index: AccSrDCqX98mi/XTRb+cqgUK/jM6DAACW5SQ From: "Rebhan, Gilbert" To: "Ant Users List" X-OriginalArrivalTime: 28 Nov 2006 06:30:22.0758 (UTC) FILETIME=[AEB1BC60:01C712B6] Content-class: urn:content-classes:message Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi, i'm still a newbie to ruby, maybe there's a more elegant solution, you need jruby available for ant http://dist.codehaus.org/jruby/jruby-bin-0.9.1.tar.gz given test.txt =3D abcd xyz what why Rebuild All: 1 failed, 0 skipped new world Rebuild All: 0 failed, 0 skipped techno Rebuild All: 1 failed, 0 skipped Rebuild All: 10 failed, 0 Skipped quick hack =3D =20 =20 $${failed} =3D=3D ${failed} =20 $${skipped} =3D=3D ${skipped} =20 depends: [script] Summary : [script] Failed =3D=3D 12 [script] Skipped =3D=3D 0 main: [echo] ${failed} =3D=3D 12 [echo] ${skipped} =3D=3D 0 BUILD SUCCESSFUL Total time: 1 second The regular expression \d{1,2} matches one or max 2 occurences of a digit, hope you don't get such a lot of failed rebuilds ;-) If needed you can match 1 or 2 or 3 digits with \d{1,3} and so on ... =20 Regards, Gilbert -----Original Message----- From: George Bills [mailto:gbills@funnelback.com]=20 Sent: Tuesday, November 28, 2006 6:14 AM To: Ant Users List Subject: Re: containsregex and concat Thanks: the regular expression works now, which is progress.=20 Unfortunately I'm getting all of the concatenated text, not just the=20 matching text. If I use replace: /> I end up getting something like: [concat] [concat] [concat] summary [concat] [concat] [concat] [concat] [concat]
[concat] SUMMARYTABLE [concat]
[concat] ...more HTML here... [concat] I'm assuming it's because the file is just one big token - but if I use=20 a line tokenizer, will I be able to match regular expressions over=20 multiple lines? Thanks for the help. Rebhan, Gilbert wrote: > Hi, > > /]*>(.*?) > > should match : > > foobar
> > also with more than one attribute > > foobar
> > > foobar is /1 (group 1) > > > Regards, Gilbert > =20 > > -----Original Message----- > From: George Bills [mailto:gbills@funnelback.com]=20 > Sent: Monday, November 27, 2006 6:41 AM > To: Ant Users List > Subject: Re: containsregex and concat > > Hrm, it probably isn't since advanced regexs are still black magic to=20 > me. The "." was supposed to match any character, including a newline=20 > (with the s flag), the * to say match 0-n of them and the ? to say be=20 > lazy, match as little as possible (so that I don't pull in=20 > ...
...
in one match). > > I just tried [^<], but it doesn't seem to work - I think because of such > > things as "...
" - the opening bracket of =20 > conflicts. I tried [.<>]*? to make sure that the "regex.body" part=20 > was matching the brackets, but that didn't work either. > > Also, was wrong -
> is a little better since the tables can have more than the class=20 > attribute (in fact, all of them do). But after changing that I'm=20 > matching the entire document - through to . That might=20 > just be because I'm using filetokenizer - if I make one match within=20 > filetokenizer, do I end up getting the entire document? If so, how do I=20 > get only the matching text? > > Regex is now:
.*?
> > Thanks for the help, I appreciate it. > > --------------------------------------------------------------------- > 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 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org