Regular expression syntax
A regular expression is a text mode consisting of common characters (such as characters a to z) and special characters (such as metacharacters. This mode describes one or more strings to be matched when searching the text subject. A regular expression is used as a template to match a character pattern with the searched string.
Here are some examples of regular expressions that may be encountered:
Visual Basic VBScript matching
Scripting Edition
/^ [] * $/"^ [] * $" Matches a blank row.
/D {2}-d {5}/"d {2}-d {5}" verify whether an ID number is composed of two characters, one
And a five-digit combination.
/<(. *)>. * </1>/"<(. *)>. * </1>" matches an HTML Tag.
The following table shows a complete list of metacharacters and their behaviors in the context of a regular expression:
Character Description
Mark the next character as a special character, a literal character, or a suffix
A quote, or an octal escape character. For example, 'n' matches the character "n ". ''
Match A linefeed. The sequence ''matches" "and" ("matches "(".
^ Matches the start position of the input string. If the RegExp object's
The Multiline attribute. ^ also matches the location after ''or.
$ Matches the end position of the input string. If the RegExp object's