Regex.match
Regex.match
Function
Returns all matching fragments in the text.
Syntax
regex(pattern, flags).match(text)
Parameters
| Parameters | Type | Required | Default value | Description |
|---|---|---|---|---|
| text | Any | No | '' | The text to be matched will be converted to a string first when called. |
Return value
| Type | Description |
|---|---|
| Array | Returns an array of all matching text; returns an empty array if there is no match. |
Example
rule = regex('[0-9]+', '') result = rule.match('a1 b22') // Output: ["1","22"] print result
Notes
- Regex.match always returns all find_iter matching results.