$Attribute = $1 (in queries only)

Tinderbox Icon

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:


Possible relevant notes (via "Similar Notes" feature):

Up: Agent Queries
Previous: Sorting Agent Results  Next: Self-referring agents 

A Tinderbox Reference File : Agent Queries : $Attribute = $1 (in queries only)

Quicklinks: Attributes | Action Codes | Export Codes | Designators | Date Formats | aTbRef Site Map

[Last updated: 16 May 2012, using v5.11.1]


Search:

Google search aTbRef for:  


Creative Commons Licence

aTbRef by Mark Anderson is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

[See aTbRef CC licence Attribution & Waiver info]

Made with Tinderbox