ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Negative Lookahead and Regexp
Date Fri, 11 Nov 2011 14:49:43 GMT
On 2011-11-10, Steve Amerige wrote:

> <target name="negate">
> <property name="a.b.c.d" value="1"/>
> <property name="a.b.c.e" value="2"/>
> <property name="a.c.x.y" value="3"/>
> <property name="p.q.r"   value="4"/>

> <propertyset id="plus"><propertyref prefix="a."/></propertyset>

your first three properties

> <propertyset id="minus" negate="true"><propertyref prefix="a.b."/></propertyset>

All Ant properties except for those that start with a.b.

> <propertyset id="union">
> <propertyset refid="minus"/>
> <propertyset refid="plus"/>
> </propertyset>

All Ant properties including the ones that start with a.b as they are
part of the plus set.

> If what I'm looking to find is "^a\.(?!b\.).*" ("a." followed by
> anything except for "b."), then this doesn't work.

<propertyset id="r"><propertyref regex="^a\.(?!b\.).*"/></propertyset>

contains just a.c.x.y for me.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message