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.captureToken([targetAttributeStr])


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

Operator Has Optional Arguments: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Stream parsing  [other Stream parsing operators]

 Baseline

 As at baseline

 [More on optional operator arguments]


Syntax note: Operators without any defined mandatory arguments may omit their empty closing parentheses


String.captureToken(targetAttributeStr)

String.captureToken()

String.captureToken

Captures a sequence of non-whitespace characters ('tokens'), the matched token string is passed to the specified targetAttributeStr, a quoted name of an attribute. The String stream is not advanced and any chained parsing continues from the same point. Punctuation (notably @) is part of a token but *not* part of a word.

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 source stream is "John Doe<johndoe@example.com>":

vText = $Text.captureToken(vString) 

results in variable vText holding " Doe<johndoe@example.com>" whilst variable vString holds "John".

This might be considered akin to a more permissive form of String.captureWord() where the first 'word' in the stream contains non-normal word characters (as long as not a space).