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)
| Parameter | Description |
| sPattern | Regular expression to use in search. |
| bCase | Indicates if the search is case sensitive. |
| bAccent | Indicates if the search takes accented characters into account. |
| bMatchWord | Indicates 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
| System | Minimal version | Remarks |
| Palm OS | Palm OS 3.0 | - |
| Windows CE | Windows CE 3.0 | - |