contains
contains(text: String;
pattern: String;
ignoreCase: Boolean): Boolean;
The contains method of the JadeRegex class determines whether the specified text contains an occurrence of the specified pattern. This method returns true if the pattern matches a portion of the whole text; otherwise it returns false.
Unlike the isMatch method, this does not require the entire specified text to match; just a portion of it.
The contains method parameters are described in the following table.
| Parameter | Description |
|---|---|
| text | Text string within which to find matches. |
| pattern | Regex pattern string. |
| ignoreCase | Specifies whether matching is case-sensitive. |
The following is an example of the contains type method.
containsExample();
constants
PatternStr = "dog";
begin
write JadeRegex@contains("the quick brown fox", PatternStr, false);// false
write JadeRegex@contains("the lazy dog", PatternStr, false);// true
end;
2020.0.01 and higher
