Difference between revisions of "Pattern Match '?' Use"
From VistApedia
Line 7: | Line 7: | ||
For example: | For example: | ||
− | + | 3N1"-"2N1"-"4N would match for NNN-NN-NNNN | |
3N <--- 2 numbers | 3N <--- 2 numbers | ||
1"-" <--- 1 hyphen | 1"-" <--- 1 hyphen | ||
Line 26: | Line 26: | ||
1995 M standards allow the following code options: | 1995 M standards allow the following code options: | ||
(1"*",1"^") <-- i.e. 1 '*' OR 1 "^" | (1"*",1"^") <-- i.e. 1 '*' OR 1 "^" | ||
− | e.g. | + | e.g. 3N1(1"-",1"/")2N1(1"-",1"/")4N |
would match for NNN-NN-NNNN OR NNN/NN/NNNN | would match for NNN-NN-NNNN OR NNN/NN/NNNN | ||
Revision as of 17:00, 21 October 2006
Use of the pattern match '?' character
The general syntax is: (MyVar?pattern)=TRUE/FALSE
"Pattern" is typically in this format:
#code#code#code...
For example:
3N1"-"2N1"-"4N would match for NNN-NN-NNNN 3N <--- 2 numbers 1"-" <--- 1 hyphen 2N <--- 2 numbers 1"-" <--- 1 hyphen 4N <--- 2 numbers
Available codes are:
N -- digits 0-9 A -- all upper or lowercase alphabetic characters P -- punctuation characters C -- ASCII controll characters E -- the entire ASCII character set U -- upper case characters L -- lowercase characters "xxx" -- must match characters in quotes (1 or more characters) 1995 M standards allow the following code options: (1"*",1"^") <-- i.e. 1 '*' OR 1 "^" e.g. 3N1(1"-",1"/")2N1(1"-",1"/")4N would match for NNN-NN-NNNN OR NNN/NN/NNNN
For the numbers portion of the syntax, the following is available:
# <-- e.g. "5" #.# <-- e.g. "5.10" means 5-10 . <-- means 0-infinity (i.e. ANY NUMBER, including NONE) #. <-- e.g. "5." means any number >= 5 .# <-- e.g. ".5" means any number <= 5