Performs regular expression operations on an input string, and sets the results to a property. There are two different operations that can be performed:
|property||The name of the property to set.||Yes.|
|override||If the property is already set, should we change it's value.
||No. Defaults to
|input||The input string to be processed||Yes.|
|regexp||The regular expression which is matched in the input string.||Yes (can be specified in a
|select||A pattern which indicates what selection pattern you want in the returned value. This uses the substitution pattern syntax to indicate where to insert groupings created as a result of the regular expression match.||Yes, unless a replace is specified|
|replace||A regular expression substitition pattern, which will be used to replace the given regular expression in the input string.||Yes, unless a select is specified|
|casesensitive||Should the match be case sensitive||No. default is "true".|
|global||Should a replacement operation be performed on the entire string, rather than just the first occurance||No. default is
|defaultValue||The value to set the output property to, if the input string does not match the specific regular expression.||No.|
\0indicates the entire property name (default).
\1indicates the first grouping
\2indicates the second grouping
<propertyregex property="pack.name" input="package.ABC.name" regexp="package\.([^\.]*)\.name" select="\1" casesensitive="false" />yields
<propertyregex property="pack.name" input="package.ABC.name" regexp="(package)\.[^\.]*\.(name)" replace="\1.DEF.\2" casesensitive="false" />yields
Copyright © 2003 Ant-Contrib Project. All rights Reserved.