Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Special Characters for Match Pattern

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Use these special characters in the regular expression input of the Match Pattern function.

Note  Use the Match Regular Expression function for more complex pattern matching.
Special Character Interpreted by the Match Pattern Function As
. Matches any character. For example, l.g matches lag, leg, log, and lug.
? Matches zero or one instances of the expression preceding ?. For example, be?t matches bt and bet but not best.
\ Cancels the interpretation of any special character in this list. For example, \? matches a question mark, \. matches a period, and \\ matches a backslash. You also can 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 portion 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.
~ Matches any character, including non-displayable characters, except for the characters or range of characters in brackets. For example, [~0-9] matches any character other than 0 through 9.
^ Matches any displayable character, including the space character, except the characters or range of characters enclosed in the brackets. For example, [^0-9] matches all displayable characters, including the space character, 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. For example, be+t matches bet and beet but not bt.
* Matches the longest number of instances of the expression preceding * in regular expression, including zero instances. For example, be*t matches bt, bet, and beet.
$ 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.

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit