Tinderbox v9 Icon


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]


 As at baseline

 [More on optional operator arguments]



Searches forward in the Stream and matches the first detected number in the stream and optionally stores that number in the attribute specified targetAttributeStr, a quoted name of an attribute. It then returns the string that follows that number (to any left side recipient) whilst the Stream is advanced to a position after the number. The operator fails if the match is empty or entirely white space, with no result.

A number is assumed to be any character continuous sequence of one or more number characters between 0–9 (zero through nine). Formatted numbers will not be fully matched. Any further text after the number is ignored, both for the capture and advancing the Stream.

Thus sequence "There are 1234 items" makes a 'number' match of 1234. But for "There are 1,234 items" or "There are 1.234 items" the match will be the first number (1) only as it is followed by a non-number character.

If the targetAttribute is omitted the Stream is advanced to after the number without any data being saved.

The attribute given for targetAttribute can be a quoted literal string, e.g. ("Text") for $Text. Or it can be an unquoted variable/loopVariable, e.g. (vString) for a variable 'vString'.

A Tinderbox Reference File : Automating Tinderbox : Coding : Action Code : Operators : Full Operator List : Stream.captureNumber[(targetAttributeStr)]