Return-Path: X-Original-To: apmail-ant-user-archive@www.apache.org Delivered-To: apmail-ant-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 79029B7DD for ; Fri, 6 Jan 2012 21:12:05 +0000 (UTC) Received: (qmail 36844 invoked by uid 500); 6 Jan 2012 21:12:04 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 36527 invoked by uid 500); 6 Jan 2012 21:12:03 -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 36513 invoked by uid 99); 6 Jan 2012 21:12:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2012 21:12:03 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of Greg.Zoller@aviall.com designates 66.150.218.7 as permitted sender) Received: from [66.150.218.7] (HELO emfs-prd-1.aviall.com) (66.150.218.7) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Jan 2012 21:11:55 +0000 Received: from emfs-prd-1.aviall.com (unknown [127.0.0.1]) by IMSA (Postfix) with ESMTP id 69239210792 for ; Fri, 6 Jan 2012 15:11:34 -0600 (CST) Received: from LDOM-PRD-2.aviallinc.com (unknown [172.18.10.71]) by emfs-prd-1.aviall.com (Postfix) with ESMTP id 3FFD720FB92 for ; Fri, 6 Jan 2012 15:11:34 -0600 (CST) To: user@ant.apache.org MIME-Version: 1.0 Subject: Advanced Regexp Question X-KeepSent: 5A42C9F7:D3C62711-8625797D:0073B663; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.2FP2 March 23, 2011 From: Greg.Zoller@aviall.com Message-ID: Date: Fri, 6 Jan 2012 15:11:34 -0600 X-MIMETrack: Serialize by Router on ldom-prd-2/Aviall(Release 8.5.2FP2|March 22, 2011) at 01/06/2012 03:11:34 PM, Serialize complete at 01/06/2012 03:11:34 PM Content-Type: multipart/alternative; boundary="=_alternative 00743FE18625797D_=" X-Virus-Checked: Checked by ClamAV on apache.org --=_alternative 00743FE18625797D_= Content-Type: text/plain; charset="US-ASCII" Hello, I am able to do some very simple regexp replacement with the replaceregexp ant task but now need to do something a little more advanced. Say I have a string in a file like this: require(["a","foo/b","foo/c"], function(){...}) What I want to do is replace all the "foo" with "bar" so the final product looks like this: require(["a","bar/b","bar/c"], function(){...}) With replaceregexp the best I've been able to get was below using regexp like "require\(\s*\[(.*)foo/([^\]]*)\]" require(["a","foo/b","bar/c"], function(){...}) (I can't just do a global replace on "foo" because I only want to do the replacement in this "require" context.) Any ideas? Thanks for any advice, Greg "If I had asked my customers what they wanted, they would have said 'A faster horse'" -- Henry Ford _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ This e-mail message, including attachments, may contain confidential, proprietary, or export controlled information. Any unauthorized disclosure, distribution, or other use is prohibited, unless expressly authorized. If you receive this e-mail in error, please notify the sender, and delete all copies of the original message from your systems. --=_alternative 00743FE18625797D_=--