This version is out of date, covering development from v6.0.0 to v6.6.5. It is maintained here only for inbound reference links from elsewhere. It is no longer actively updated.

Jump to the current version of aTbRef

TinderboxSix Icon

Quoting Regular Expressions

As action code syntax eclipses older syntaxes there is some scope for confusion where regular expressions are used. In the new v5.7+ 'dot' operators, e.g. String.contains(pattern), one of the options for the 'pattern' parameter is a regex which needs to be quoted - enclosed in double quotes. This conforms to a general rule of thumb that anything that is a string (literal, template name, regex, etc.) should be quoted. This helps Tinderbox to detect where the parameter is actually an expression.

The exception to this is the long standing AttributeName(pattern) operator originally introduced as part of the query language; with this do not quote your regular expression. This operator should new be considered deprecated in favour of the $Attribute.contains(pattern) operator. Thus:

Old usage: $MyString(\W+) (now deprecated)

Current usage: $MyString.contains("\W+")

A Tinderbox Reference File : Objects & Concepts : Coding conventions : Quoting Regular Expressions