From 1159111b7a71b72eb04326df33211e1733f7e742 Mon Sep 17 00:00:00 2001 From: mattinger Date: Thu, 6 Jul 2006 21:53:00 +0000 Subject: Initial addition into subversion with build script changes git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/trunk/ant-contrib@5 32d7a393-a5a9-423c-abd3-5d954feb1f2f --- docs/manual/tasks/propertyregex.html | 133 +++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 docs/manual/tasks/propertyregex.html (limited to 'docs/manual/tasks/propertyregex.html') diff --git a/docs/manual/tasks/propertyregex.html b/docs/manual/tasks/propertyregex.html new file mode 100644 index 0000000..33b855e --- /dev/null +++ b/docs/manual/tasks/propertyregex.html @@ -0,0 +1,133 @@ + + + + Ant-contrib Tasks: PropertyRegex + + + +

PropertyRegex

+ +

Performs regular expression operations on an input string, and sets + the results to a property. There are two different operations that + can be performed: +

    +
  1. Replacement - The matched regular expression is replaced with + a substitition pattern
  2. +
  3. Selection - Groupings within the regular expression are selected + via a selection expression. +
+

+ +

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AttributeDescriptionRequired
propertyThe name of the property to set.Yes.
overrideIf the property is already set, should we change it's value. + Can be true or falseNo. Defaults to false
inputThe input string to be processedYes.
regexpThe regular expression which is matched in + the input string.Yes (can be specified in a + <regexp> subelement). +
selectA 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
replaceA regular expression substitition pattern, which will be used + to replace the given regular expression in the input string.Yes, unless a select is specified
casesensitiveShould the match be case sensitiveNo. default is "true".
globalShould a replacement operation be performed on the entire + string, rather than just the first occuranceNo. default is false.
defaultValueThe value to set the output property to, if the + input string does not match the specific regular expression.No.
+ +

Select expressions

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

Replacement

+ It is important to note that when doing a "replace" operation, + if the input string does not match the regular expression, then + the property is not set. You can change this behavior by supplying + the "defaultValue" attribute. This attribute should contain the value + to set the property to in this case. + +

Example

+ +
+    
+    <propertyregex property="pack.name"
+              input="package.ABC.name"
+              regexp="package\.([^\.]*)\.name"
+              select="\1"
+              casesensitive="false" />
+    
+    yields ABC
+    
+ +
+    
+    <propertyregex property="pack.name"
+              input="package.ABC.name"
+              regexp="(package)\.[^\.]*\.(name)"
+              replace="\1.DEF.\2"
+              casesensitive="false" />
+    
+    yields package.DEF.name
+    
+ +
+

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

+ + + -- cgit v1.2.3