Determines whether the specified string matches the given regular expression pattern.

Syntax

Smartsite SXML CopyCode image Copy Code
boolean string.ismatch(string s, string pattern)
boolean string.ismatch(string s, string pattern, enum options)

Parameters

Name Data Type Description
s String The string to test.
pattern String The pattern to match.
options Enum TheSystem.Text.RegularExpressions.RegexOptions.
Enum values:
  • None
    Specifies that no options are set.
  • IgnoreCase
    Specifies case-insensitive matching.
  • Multiline
    Multiline mode. Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string.
  • ExplicitCapture
    Specifies that the only valid captures are explicitly named or numbered groups of the form. This allows unnamed parentheses to act as noncapturing groups without the syntactic clumsiness of the expression (?:…).
  • Compiled
    Specifies that the regular expression is compiled to an assembly. This yields faster execution but increases startup time.
  • Singleline
    Specifies single-line mode. Changes the meaning of the dot (.) so it matches every character (instead of every character except \n).
  • IgnorePatternWhitespace
    Eliminates unescaped white space from the pattern and enables comments marked with #. However, the System.Text.RegularExpressions.RegexOptions.IgnorePatternWhitespace value does not affect or eliminate white space in character classes.
  • RightToLeft
    Specifies that the search will be from right to left instead of from left to right.
  • ECMAScript
    Enables ECMAScript-compliant behavior for the expression. This value can be used only in conjunction with the System.Text.RegularExpressions.RegexOptions.IgnoreCase, System.Text.RegularExpressions.RegexOptions.Multiline, and System.Text.RegularExpressions.RegexOptions.Compiled values. The use of this value with any other values results in an exception.
  • CultureInvariant
    Specifies that cultural differences in language is ignored. for more information.

Return Value

Data Type Description
Boolean True if the pattern matches.

Expand image Example

SXML