You can combine a pattern query with an action that will use the value of the found pattern:
query: Text(email: (\w+)<(.+)>)
action: $email=$2
...will set the value of attribute TheAddress to the third back-reference pattern found in text, in the above case the string enclosed by angle brackets. If the whole target $Text were:
Source email: John<john@example.com>, on 24/03/2010
...then the above query gives these back-references:
$0: email: John<john@example.com>
$1: John
$2: johndoe@example.com
$0 is always the whole matched (sub-)string for the target attribute value but if the regex pattern creates additional back-references then $1 through $9 may be used to access those additional match string. Back-references are returned in the order created; to understand that process better, read up on regular expression back-references.
This syntax for using back-references can only be used in the context of a query, such as:
- agents
- if() operators in actions/rules.
