Home > Language Reference > Classes > StringMatcher

SetRegExp Method

Sets the regular expression.

Syntax

Public Sub SetRegExp(ByRef sPattern As String, ByVal bCase As Boolean, ByVal bAccent As Boolean, ByVal bMatchWord As Boolean)

ParameterDescription
sPatternRegular expression to use in search.
bCaseIndicates if the search is case sensitive.
bAccentIndicates if the search takes accented characters into account.
bMatchWordIndicates if only complete words are recognized.

Remarks

The SetRegExp method sets the search pattern for the StringMatcher object. The previous search pattern used in the last call to this method or the SetPattern method is lost, and replaced by the new one.

The sPattern parameter specifies the regular expression to use in the search. Refer to the regular expressions page to see the syntax recognized by HB++. If you do not need to specify any wildcards, use the SetPattern method to set the pattern instead.

The bCase parameter specifies whether the search should be case sensitive. For example, if this parameter is set to False, the characters "A" and "a" are considered to be the same.

The bAccent parameter specifies whether the search should distinguish between accented and non accented characters. For example, if this parameter is set to False, the characters "a" and "à" are considered to be the same.

The bMatchWord parameter specifies whether the search should recognize a whole word, that is to say surrounded by spaces or punctuation marks.

The StringMatcher introduction page gives a full example of this object and its methods.

System requirements

SystemMinimal versionRemarks
Palm OSPalm OS 3.0-
Windows CEWindows CE 3.0-