Skip to content

MatchAll - cRegEx

Finds all matches and returns the match values in a string array

Type: Function
Return Data Type: String[]

Parameters

Parameter Type Description
sSubject String The host string to run the regular expression on

Syntax

Function MatchAll String sSubject Returns String[]

Call Example

Get MatchAll sSubject to String[]Variable

Description

Finds all matches and returns the match values in a string array.

Returns an array of strings with all the match values found in the subject string. Only full matches will be returned and not the separate matching groups.

Sample

The example below shows how to use MatchAll to get match values into an array of string. So aValues[0] will contain "John" and aValues[1] will contain "2012/06/21".

Object oDataSeparator is a cRegEx 
    Set psExpression to "[^;,\t ]+" 
End_Object 

String[] aValues 
Get MatchAll of oDataSeparator "John, 2012/06/21, 90kg, Designer" to aValues

Return Value

Array of all matches