string.regex
This function checks whether a regular expression pattern matches a string.
Syntax
string.regex(pattern, str)
Arguments
Argument |
Type |
Description |
---|---|---|
pattern |
string |
Regular expression pattern against which the source string needs to be matched. |
str |
string |
Source string |
Returns
Type |
Description |
---|---|
boolean |
|
Examples
The function string.regex("foo.*", "seafood")
returns true
.