VBS Tutorial: Regular Expression introduction-create a regular expression
Create a regular expression
The method for constructing a regular expression is the same as that for creating a mathematical expression. That is, a larger expression is created by combining a small expression with a variety of metacharacters and operators.
You can construct a regular expression by placing various components in expression mode between a pair of delimiters. For Visual Basic Scripting Edition, The Delimiter is a forward slash (/) character. For example:
/Expression/
For VBScript, a pair of quotation marks ("") are used to determine the boundary of the regular expression. For example:
"Expression"
In the two examples shown above, the regular expression mode (expression) is stored in the Pattern attribute of the RegExp object.
The regular expression component can be a single character, Character Set combination, character range, choice between characters, or any combination of all these components.