|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RegularExpressionAction
Searches for strings in a file or an input string that match a regular expression. Optionally, within the search results, the first or all of those matching strings can be replaced with a different string. The file contents and the input string are not modified. The result lists the matching strings, optionally replaced by different strings. If both the replaceFirst and replaceAll properties have been set on this action, the first matching string is replaced by the replaceFirst property and the remaining matching strings are replaced by the replaceAll property.
The Regular Expression Action returns its result in the flow context variable "RESULT". The following table contains more information on accessing and using the result.Flow Context Variable | Field | Java Type | Description |
---|---|---|---|
RESULT | matched | boolean | A boolean indicating whether the regular expression pattern was found in the input content. |
RESULT | end | int | The 0-based index of the last character matched of the input. |
RESULT | groupCount | int | The number of matches found. |
RESULT | groups | java.lang.String[] | The input sequences matched by the regular expression pattern. If the replaceFirst and / or replaceAll properties are used, this result will contain the replaced text. |
RESULT | start | int | The 0-based location of the first occurrence of the regular expression matched in the input file or input string. |
RESULT | replaced | int | The input, with groups matched by the regular expression pattern replaced by the replaceFirst and replaceAll properties. ignored. If replaceFirst is used, only the first matching group is replaced. |
Nested Class Summary | |
---|---|
static class |
RegularExpressionAction.RegularExpressionActionResult
The result when a RegularExpressionAction runs. |
Method Summary | |
---|---|
java.lang.String |
getInput()
Returns the input string content that the regular expression will test. |
java.lang.String |
getInputFilename()
Returns the name of the input file that the regular expression will test. |
java.lang.String |
getPattern()
Returns the regular expression against which the input string or file contents will be tested. |
java.lang.String |
getReplaceAll()
Returns the content that will replace all occurrences of the regular expression in the input file or input string. |
java.lang.String |
getReplaceFirst()
Returns the content that will replace the first occurrence of the regular expression in the input file or input string. |
void |
setInput(java.lang.String input)
Sets the input string content which the regular expression will test. |
void |
setInputFilename(java.lang.String filename)
Sets the name of the input file which the regular expression will test. |
void |
setPattern(java.lang.String pattern)
Sets the regular expression against which the input file or input string will be tested. |
void |
setReplaceAll(java.lang.String value)
Sets the content that will replace all occurrences of the regular expression in the input file or input string. |
void |
setReplaceFirst(java.lang.String value)
Sets the content that will replace the first occurrence of the regular expression in the input file or input string. |
Methods inherited from interface flux.runtimedatamap.RuntimeDataMap |
---|
getRuntimeDataMap, setRuntimeDataMap |
Method Detail |
---|
java.lang.String getInput()
java.lang.String getInputFilename()
java.lang.String getPattern()
java.lang.String getReplaceAll()
java.lang.String getReplaceFirst()
void setInput(java.lang.String input)
input
- The input string content which the regular expression will
test.void setInputFilename(java.lang.String filename)
filename
- The name of the input file which the regular expression
will test.void setPattern(java.lang.String pattern)
pattern
- A regular expression pattern.void setReplaceAll(java.lang.String value)
value
- The content that will replace all occurrences of the regular
expression in the input file or input string.void setReplaceFirst(java.lang.String value)
value
- The content that will replace the first occurrence of the
regular expression in the input file or input string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |