QTP - vbscript Patterns Matchings...
Ø
These sets of patterns can be broken
down into several categories and areas
o
Position
Matching.
o
Literals.
o
Character
Classes.
o
Repetition.
o
Alternation
& Grouping.
o
Back
references
Ø
Position
Matching:
Ø
^
o
Only match the beginning of a
string.
o
"^A" matches first
"A" in "An Arnold. “.
Ø
$
o
Only match the ending of a string.
o
"t$" matches the last
"t" in "Promotional offer Letter in then list “.
Ø
\b
o
Matches any word boundary.
o
"al\b" matches "al"
in "Promotional Offer. “
Ø
\B
o
Matches any non-word boundary.
Ø
Literals:
o Literals
can be taken to mean alphanumeric characters, ACSII, octal characters,
hexadecimal characters, UNICODE, or special escaped characters.
|
\n |
Matches a new line. |
|
\f |
Matches a form feed. |
|
\r |
Matches carriage return |
|
\t |
Matches horizontal tab. |
|
\v |
Matches vertical tab. |
|
\? |
Matches ? |
|
\* |
Matches * |
|
\+ |
Matches + |
|
\. |
Matches . |
|
\| |
Matches | (pipe) |
|
\{ |
Matches { |
|
\} |
Matches } |
|
\\ |
Matches \ |
|
\] |
Matches ] |
|
\[ |
Matches [ |
|
\( |
Matches ( |
|
\) |
Matches ) |
|
\xxx |
Matches the ASCII character
expressed by the octal number xxx. “\50" matches "("
or chr (40). |
|
\xdd |
Matches the ASCII character
expressed by the hex number dd. "\x28" matches
"(" or chr (40). \} |
|
\uxxxx |
Matches the ASCII character
expressed by the UNICODE xxxx. "\u00A3" matches "£".
|

