ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "bill/wilandra" <b...@wilandra.com>
Subject RE: propertyregex
Date Thu, 02 Mar 2006 16:34:01 GMT
Try reg exp 

Sticky\s+Tag:\s+([^\s]+)\s.*

or some variation of it. Replacement register 1 will contain the REL_1_0
from the sample string.

It says select the word "Sticky" followed by one or more whitespace elements
followed by the word "Tag" followed by a colon followed by one or more
whitespace elements. Place everything up to the next whitespace element (if
there is at least one element that is not a whitespace element in register 1
then select the rest of the string.

HTH Bill

-----Original Message-----
From: Mark Lybarger [mailto:mlybarger@gmail.com] 
Sent: Thursday, March 02, 2006 8:11 AM
To: user@ant.apache.org
Subject: propertyregex

i want to set a property using propertyregex from ant-contrib. i'm not a
regex expert/novice.

here's my string:
   Sticky Tag:		REL_1_0 (branch: 1.3.2)

I'd like to extract the REL_1_0 (third word, or word after Sticky
Tag:) to a property. some help with the regexp of it would be helpfull.
thanks!

<propertyregex property="n_cvs.branch" input="${m_cvs.branch}"
regexp="(\w+)" select="\0" casesensitive="false" />

---------------------------------------------------------------------
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


Mime
View raw message