Tinderbox v10 Icon

String.extractAll(regexStr[, caseInsensitiveBln])


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Data Type Returned: 

Operator First Added: 

Operator in Current Baseline: 

Operator Last Altered: 

Operator Uses Regular Expressions: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Data manipulation  [other Data manipulation operators]

 List [about List data type]

 v9.1.0

 Baseline

 As at baseline

 [More on regular expressions in Tinderbox]


String.extractAll(regexStr)

The operator returns a (semi-colon delimited) list of all matches for a quote-enclosed regexStr found in the source String.

For example:

$MyList = $Text.extractAll("#[A-Za-z]+"); 

would return a list of all discrete tag instances in the source String such as: "#Tinderbox;#Stuff;#Thing;#tinderbox;#Tinderbox;#Cars".

To get a de-duped list, without the hashes we can chain other operators:

$MyList = $Text.extractAll("#[A-Za-z]+").unique.replace("#",""); 

That refines the returned list: "Cars;Stuff;Thing;Tinderbox;tinderbox". Note the extra operators also sort the list too.

String.extractAll(regexStr[, caseInsensitiveBln])

String.extractAll() now accepts an optional boolean second argument caseInsensitiveBln. If that argument is true, the regex argument's regular expression search is case-insensitive. The default value is false respecting the pre-existing behaviour.


See also—notes linking to here: