/
firstMatch
firstMatch
Function: firstMatch()
Returns the value of the first element of an Array that matches a Regular Expression or Numeric Expression.
Syntax
firstMatch(array, regExp)
Argument | Type | Description |
---|---|---|
array | Array | An array of Strings or Numbers |
regExp | Numeric Expression | A numeric or string-based regular expression. |
Examples
firstMatch(["JOHN", "FREDDY", "FRANK"], "^[FR].*")
Returns the first string beginning with "FR" i.e "FREDDY".
firstMatch([99, 166, 27], "<90 | 150..200")
Returns the first number which is lower than 90 OR between 150 and 200 i.e. 166. Note that the numeric expression is quoted when used as an argument to firstMatch()
See Also
Related content
firstMatch
firstMatch
More like this
SubList Macro
SubList Macro
Read with this
firstMatch
firstMatch
More like this
Array Handling Functions
Array Handling Functions
Read with this