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

Jump to the current version of aTbRef

Tinderbox v9 Icon

String.captureTo(matchStr[, targetAttributeStr])


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

Operator Uses Regular Expressions: 

Operator Has Optional Arguments: 


String.captureTo(matchStr, targetAttributeStr)

String.captureTo(matchStr)

Stores the source text string up to, but not including, the designated literal matchStr into the specified targetAttributeStr, a quoted name of an attribute, and returns the string that follows matchStr. Note that matchStr is not a regular expression and can only be a literal string.

If the targetAttributeStr is omitted the String is advanced to the end so processing ceases.

The value given for targetAttributeSt can be:

For example, if the stream is "Piglet, a friend of Pooh" and if wishing to capture only the name 'Piglet' into $SomeAttribute:

$Result = $Text.captureTo(", ","SomeAttribute"); 

Now, the value of $Result is "a friend of Pooh" and of $SomeAttribute is "Piglet".