VSFlexString Control > VSFlexString Properties, Events, and Methods > VSFlexString Properties > Pattern Property |
Returns or sets the regular expression used for matching against the Text string.
[form!]VSFlexString.Pattern[ = value As String ]
The regular expression syntax recognized by VSFlexString is based on the following special characters:
Char |
Description |
^ |
Beginning of a string. |
$ |
End of a string. |
. |
Any character. |
[list] |
Any character in list. For example, "[AEIOU]" matches any single uppercase vowel. |
[^list] |
Any character not in list. For example, "[^ ]" matches any character except a space. |
[A-Z] |
Any character between 'A' and 'Z'. For example, "[0-9]" matches any single digit. |
? |
Repeat previous character zero or one time. For example, "10?" matches "1" and "10". |
* |
Repeat previous character zero or more times. For example, "10*" matches "1", "10", "1000", etc. |
+ |
Repeat previous character one or more times. For example, "10+" matches "10", "1000", etc. |
\ |
Escape next character. This is required to any of the special characters that are part of the syntax. For example "\.\*\+\\" matches ".*+\". It is also required to encode some special non-printable characters (such as tabs) listed below. |
{tag} |
Tag this part of the match so you can refer to it later using the TagString property. |
In addition to the characters listed above, there are seven special characters encoded using the backslash. These are listed below:
Code |
Description |
ASCII Code |
VB Symbol |
\a |
Bell (alert) |
7 |
N/A |
\b |
Backspace |
8 |
N/A |
\f |
Formfeed |
12 |
N/A |
\n |
New line |
10 |
VbLf |
\r |
Carriage return |
13 |
VbCr |
\t |
Horizontal tab |
9 |
VbTab |
\v |
Vertical tab |
11 |
N/A |
For some examples and more details, see the Regular Expressions topic.
String