Patterns are powerful tools for defining ranges because they can include wildcard characters. Wildcard characters can be used to represent a single digit or a group of characters. This allows you to define large ranges of valid values. For example, you can define an attribute’s range as “DR* REV*” where the asterisk (*) is a wildcard representing any character or characters. This range allows the user to enter any value, as long as the first half begins with the letters “DR” and the second half begins with the letters “REV”. When using a pattern to define a range, you must use a pattern operator. These operators compare the user’s value with the pattern range. All the pattern operators allow for wildcard comparisons. Two of them check the user’s entry for an exact match (including checks for uppercase and lowercase).
When the user enters a character string value, these operators compare that value to the defined range pattern. If the comparison results in a true value, the user value is considered valid and is assigned to the attribute. If the comparison is false, the user value is considered out of range and is not valid. |