A Tinderbox Reference File : Agent Queries : String Attributes - comparison operators | aTbRef Site Map |
String Attributes - comparison operators |
Comparison Operators
Note that the = operator always works as a case-sensitive comparison.
The agent queries >, >=, <, and <= allow a new form
$Name > $AttribName
or
$AttribName > $AttribName(path)
This allows queries such as
$Created>$Created(parent)
$Name<$Text
$BorderColor=$Color
To match all case variants of 'dog' (dog, Dog, DOG, etc.) use a 'contains' pattern match, MyAttr(dog)
. As this would also find a value 'big dog' the match can be further restricted by regular expression string delimiters, e.g. MyAttr(^^dog$)
. The caret (^) forces matching to start at the beginning of the string; it has to be doubled so as to escape it for Tinderbox, i.e. tell the program the symbol is not, in this context, export mark-up code. Similarly, the $ forces the match to run all the way to the end of a value string. This therefore excludes longer strings that might contain the word in question.
NOTE: The use of the $ in a regular expression should not be confused with the $AttributeName usage.
Up: Agent Queries | |
Previous: Attribute value pattern matching | Next: $Attribute = $1 (in queries only) |
Licensed under Creative Commons Attribution-Noncommercial-Share Alike 3.0 License
[See aTbRef CC licence Attribution/Waiver info info]