Purpose
Matches the given RegEx pattern with the input string and returns TRUE if the given expression matches the whole string. Otherwise, the function returns FALSE. You can call this function from the MapBasic window in MapInfo Pro.
Syntax
RegExMatch$(input_string, expression_string [, case_insensitive ] )
input_string (String): A string with the target sequence (the subject) against which the RegEx expression is matched.
expression_string (String) : The RegEx pattern to match the string to.
case_insensitive (Logical) : Character matching should be performed without regard to case.(This parameter is Optional) (default value is TRUE)
.
Return Value
Logical
Description
Use the RegexMatch$() function to match the given RegEx pattern with the input string. This function returns TRUE if the given expression matches the whole string. Otherwise, the function returns FALSE.
case_insensitive is optional and defaults to TRUE.
Examples
print RegExMatch$("foo.txt", "[a-z]+\.txt")
//returns T
print RegExMatch$("foo.txt", "[a-z]+\.TXT", FALSE)
//returns F
Print RegExMatch$("xxxabc123xyz","abc.*xyz")
//returns F ‘Use RegExSearch$ to get substring match.