DTN ProphetX® Web Services

Search Patterns

PXWeb web services use string pattern matching in some places to make a user's or administrator's job easier.  Powerful useful patterns can be expressed with a small wildcard expression. 

Patterns are described by some combination of special and normal characters.  By default, patterns that consist of all lowercase or all uppercase letters are not case sensitive (AB will match AB, ab, Ab, and aB).  Patterns that consist of mixed cases are case sensitive (Ab will match only Ab). 

Special Characters

CharacterDefinition
?Match a single character.
<set>Match any single character contained in the set. For example, <0-2> will match with 0, 1, and 2.
{set}Match a substring composed of one or more of the characters described by the set.
#Match one numeric character. (This is equivalent to <0-9>.)
` (backquote)Match one month code letter.  (Month code letters are FGHJKMNQUVXZ, so the backquote is equivalent to <FGHJKMNQUVXZ>.)
' (quote)Match one second year month code letter.  (Second year month code letters are ABCDEILOPRST, so the quote is equivalent to <ABCDEILOPRST>.)
" (doublequote)Match one first or second year month code letter.  (doublequote is equivalent to <ABCDEFGHIJKLMNOPQRSTUVXZ>, or any letter except W and Y).
*Match a substring composed of one or more characters.
^Use a carat as the first character of your pattern to make a case-sensitive match.  (The carat is needed only if your pattern consists of all lowercase or all uppercase letters -- for example, ABC or abc.  By default, patterns containing mixed uppercase and lowercase letters are automatically treated as case sensitive.)
\The escape character.  This removes the special significance of the next character, allowing you to search for it as itself.  For example, \# matches the character # rather than any single numeric character.  To search for the escape character (backslash) itself, enter \\.
&The ampersand character.  The & represents itself with sets.  Outside of sets it is ignored, Unless it occurs within a fixed text substring of the pattern.  In that case, it has the effect of breaking fixed substrings into two substrings for the purpose of matched pattern substitution.  This is used in regular expression reformatting and in symbol translation. See the XLate documentation for examples of this usage.

Character Set Descriptions

^If the first character of a set is carat, then the opposite of set will be matched -- that is, everything except the pattern described by the set.
AA single character represents itself.
A-CTwo characters separated by a hyphen describe themselves and the range of characters between them.  For example, A-C will match A, a, B, b, C, and c.
-A hyphen at the beginning of the set (but after the ^ if there is one) represents itself.
\A backslash escapes the next character's special meaning.  It may be used to add any character to the set, including \ and > and }.

Fixed Substrings

Any substring of the pattern which is not a special character or a character set is considered a fixed substring of the pattern. 

Limits

The pattern can only contain ASCII 1-127. 

A pattern can have up to 10 components, where a component is either a fixed string, a # or * or ?, or a {set}. Multiple adjacent # or * or ? characters are considered a single component. 

The sum of the lengths of the fixed strings in the pattern is limited to about 200 characters (or less if sets are used). 

Wildcard Examples

PatternExample Matches
catMatches cat, CAT, Cat, cAt ...
^catMatches cat
cat*Matches cat, cattail, catawba ...
*catMatches cat, deadcat ...
ca*lMatches call, cattail ...
c*#4PMatches cat34P, c99xx234P, and c04P, but does not match c4p, c4P, or c04p
c*{0-9}4pMatches cat34p, c99xx234P, c8384204P
<a-cfr-t>Matches a A b B c C f F r R s S t T
{a-cfr-t}Matches caT, bat, bar, Barf, art, bass ...
SP`#{0-9}<CP>Matches SPZ350C and other standard S&P options, but will not match SPZ4.