Regex.matchSimple

Scans for a match in string for pattern.

This function is equivalent to Regex.match but it does not require to compile the pattern with Regex.new, avoiding some lines of code when you need just to do a match without extracting substrings, capture counts, and so on.

If this function is to be called on the same pattern more than once, it's more efficient to compile the pattern once with Regex.new and then use Regex.match.

class Regex
static
bool
matchSimple

Parameters

pattern string

the regular expression

string_ string

the string to scan for matches

compileOptions GRegexCompileFlags

compile options for the regular expression, or 0

matchOptions GRegexMatchFlags

match options, or 0

Return Value

Type: bool

TRUE if the string matched, FALSE otherwise

Meta

Since

2.14