beautypg.com

Pattern matching characters – Kipp&Zonen UVS-E-T UV Radiometers User Manual

Page 55

background image

19. Pattern Matching Characters

55

UVIATOR software manual

Character

Description

.

Matches any character

?

Matches zero or one instances of the expression proceeding

\

Cancels the interpretation of special characters (for example, \? matches a question mark).

You can also use the following constructions for the space and non-displayable characters:

\b backspace

\f form feed

\n newline

\s space

\r carriage return

\t tab

\xx any character, where xx is the hex code using 0 through 9 and upper case A through F

^

If ^ is the first character of regular expression, it anchors the match to the offset in string. The match fails

unless regular expression matches that topic of string that begins with the character at offset. If ^ is not the

first character, it is treated as a regular character.

[ ]

Encloses alternates. For example, [abc] matches a, b or c. The following character has special significance

when used within the brackets in the following manner.

- (dash)

Indicates a range when used between digits, or lowercase or uppercase letters (for example, [0-5],[a-g],or [L-Q])

The following characters have significance only when they are the first character within the brackets.

~

Excludes the set of characters, including non-displayable characters. [~0-9] matches any character other

than 0 through 9.

^

Excludes the set with respect to all the displayable characters (and the space characters). [^0-9] gives the

space characters and all displayable characters except 0 through 9.

+

Matches the longest number of instances of the expression preceding +;

there must be at least one instance to constitute a match.

*

Matches the longest number of instances of the expression preceding * in regular expression,

including zero instances.

$

If $ is the last character of regular expression, it anchors the match to the last element of string.

The match fails unless regular expression matches up to and including the last character in the string.

If $ is not last, it is treated as a regular character.