Selects property names that match a given regular expression and returns them in a delimited list


Attribute Description Required
property The name of the property you wish to set. Yes.
override If the property is already set, should we change it's value. Can be true or false No. Defaults to false
match The regular expression which is used to select property names for inclusion in the list. This follows the standard regular expression syntax accepted by ant's regular expression tasks. Yes.
select A pattern which indicates what selection pattern you want in the returned list. This used the substitution pattern syntax to indicate where to insert groupings created as a result of the regular expression match. No. default is "\0".
casesensitive Should the match be case sensitive No. default is "true".
delimiter The delimiter used to seperate entries in the resulting property No. default is ",".
distinct Should the returned entries be a distinct set (no duplicate entries) No. default is "false".

Select expressions

Expressions are selected in a the same syntax as a regular expression substitution pattern.


The following code
    <property name="" value="abc pack name" />
    <property name="" value="def pack name" />
    <property name="" value="ghi pack name" />
    <property name="" value="jkl pack name" />

    <propertyselector property="pack.list"
                         casesensitive="false" />

would yield the results
You could then iterate through this list using the ForEach Task as follows:
    <foreach list="${pack.list}"
                param="" />

    <target name="" >
      <propertycopy name="" value="package.${}.name" />
      <echo message="${}" />
Would print
      [echo] abc pack name
      [echo] def pack name
      [echo] ghi pack name
      [echo] jkl pack name

Copyright © 2003 Ant-Contrib Project. All rights Reserved.