isMatch

isMatch(text:       String;
        pattern:    String;
        ignoreCase: Boolean): Boolean;

The isMatch method of the JadeRegex class determines if the specified text completely matches the specified pattern. This method returns true if the whole of the specified text string matches the specified pattern and case‑sensitivity; otherwise it returns false.

For a match to occur, the pattern must match the entire specified text.

The isMatch method parameters are described in the following table.

Parameter Description
text Text string against which to determine a match
pattern Regex pattern string
ignoreCase Specifies whether matching is case-sensitive

The following is an example of an isMatch type method.

isMatchExample();
vars
    validEmail, invalidEmail, emailValidation : String;
begin
    validEmail := "john.doe@example.com";
    invalidEmail := "john.,doe@example.com";
    emailValidation := "\b[\w.-_]+@[\w.-_]+\b";
    write JadeRegex@isMatch(validEmail, emailValidation, true); // true
    write JadeRegex@isMatch(invalidEmail, emailValidation, true); // false
end;

2020.0.01 and higher