Pattern
Strings
The pattern strings used with the getCatalogedPathnames(
) methods filter the list of
returned pathnames in a user-specified manner. Pattern strings can be specified in
two modes: pathname mode and pathname part mode. Both modes make use of pathname
part filters:
-
Pathname mode =
/Afilter/Bfilter/Cfilter/Dfilter
/Efilter/Ffilter/
-
Pathname part mode = [A=Afilter] [B=Bfilter]
[C=Cfilter] [D=Dfilter] [E=Afilter]
[F=Ffilter]
In pathname mode, filters must be supplied for all pathname parts. In pathame part
mode, only those parts that will not match everything must be specified.
Filters are comprised of the following components:
-
Normal text characters. These characters are interpreted as they
appear. For example, a pattern string of B=XYZ specifies matching every
pathname that has a B-part of XYZ.
-
Special characters. The special characters are comprised of the following
list:
-
@ or * (used interchangeably). This character can be
specified as the first and/or last character of a filter and specifies matching a
string of zero or more characters. For example, a pattern string of B=XYZ@
specifies matching every pathname that as a B-part that begins with XYZ. A
pattern string of B=*XYZ specifies matching every pathname that has a B-part that
ends with XYZ. A pattern string of B=*XYZ* specifies matching every
pathname that XYZ anywhere in the B-part. Note that the @ or
* character must be the first and/or last character of the filter (e.g. a
pattern string of B=ABC*XYZ is invalid).
-
# or ! (used interchangeably). This character must be
specified as the first character of a filter and specifies matching of every string
except the remainder of the filter (e.g. it negates the remainder of the
filter). A pattern string of B=!XYZ* specifies matching every pathname that
does not have a B-part that begins with XYZ.
-
No character. The absence of any character specifies an empty filter, which
matches a blank pathname part. Both of the following pattern strings match every
pathname that has a blank A-part:
Using getCatalogedPathnames(
) with a pattern string utilizes the pathname matching in
the underlying DSS library. To accomplish more sophisticated pathname filtering,
use one of the getCatalogedPathnames(
) methods in conjunction with python text parsing
and matching utilities.