REmatch

Uses a regular expression (RE) to search a string for a pattern, starting from a specified position.

REmatch(reg_expression, string) → returns Array

Argument Reference for the REmatch function

Name Required Default Description
reg_expression Yes Regular expression for which to search. Case sensitive.
string Yes A string or a variable that contains one. String in which to search.

Links more information about REmatch

Examples sample code invoking the REmatch function


Simple REMatch Example

Extracts numbers from a string and returns them as an array

serializeJSON( reMatch("[0-9]+", "1 way to extract any number like 45, 38") )

Expected Result: ["1","45","38"]


Fork me on GitHub