Tinderbox v9 Icon

String.extractAll(regexStr[, caseInsensitiveBln])

Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

Operator Uses Regular Expressions: 


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])

From v9.5.0, 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.