Wildcards and Regular Expressions

Introduction

Universal Controller supports the use of wildcards and regular expressions in the user interface and remote interfaces.

For files, wildcards and regular expressions can be used only in:

  • Source file specifications, not destination file specifications. (Under some operating systems, it is possible for * and ? to be valid characters in a file name. If they appear in a destination file, they are treated as file characters, not as wildcards or regular expressions.)
  • File name portion of file specifications, not as part of the directory.

Wildcards

Universal Controller supports two wildcards:

  • Asterisk (*)
  • Question mark (?)

You can use wildcards in record searches and when applying some rule or command against records. Fields that support wildcards are identified in their field description.
 

Wildcard

Meaning

Asterisk (*)

Represents a wildcard of any number of characters.
 
For example, a search for string "FEE*SF" returns all records whose name begins with "FEE" and ends with "SF", with any number and type of characters between the two strings.

Question mark (?)

Represents a wildcard of one character in a specific position.
 
For example, a search for string "FEE?SF" returns all records whose name begins with "FEE" and ends with "SF", with any single character between the two strings.

Multiple questions marks

Represent wildcards of multiple characters in a specific position.
 
For example, a search for string "FEE??SF" returns all records whose name begins and ends with "FEE" and "SF", respectively, with any two characters between the two strings.

File Name Examples

File Names

  1. test.txt
  2. test1.txt
  3. test2.txt
  4. test3.txt
  5. test.bin
  6. test1.bin
  7. test2.bin
  8. test3.bin

Wildcard Matches

  • *, *.*, test*.*, and tes?**. will match all of the files.
  • *.txt will match files 1 - 4.
  • *.bin will match files 5 - 8.
  • test?.txt will match files 2 - 4.

Regular Expressions

Important!

POSIX Extended Regular Expression syntax is used for file name matching and string matching.

Note

You can use regular expressions only on Windows and UNIX operating systems; you cannot use them on z/OS.

File Name Examples

File Names

  1. test.txt
  2. test1.txt
  3. test2.txt
  4. test3.txt
  5. test.bin
  6. test1.bin
  7. test2.bin
  8. test3.bin

Regular Expression Matches

  • .+, tes.+, and te.+[tn]$ will match all of the files.
  • .+txt$ will match files 1 - 4.
  • .+bin$ will match files 5 - 8.
  • te..[123].+bin$ will match files 6 - 8.

String Examples

C:\UDM\TEST\OUT\LinuxSystem.[D](20)[1-9][1-9][0-1][0-9][0-3][0-9][.][T][0-2][0-9][0-5][0-9][0-5][0-9].*

Matches C:\UDM\TEST\OUT\LinuxSystem.D20171001.T235159.*

C:\UDM\TEST\OUT\LinuxSystem.[D][1-9][1-9][0-1][0-9][0-3][0-9][.][T][0-2][0-9][0-5][0-9][0-5][0-9].*

Matches C:\UDM\TEST\OUT\LinuxSystem.D171001.T235159.*

C:\UDM\TEST\OUT\LinuxSystem.[D](20)[1-9][1-9][0-1][0-9][0-3][0-9][.][T][0-2][0-9][0-5][0-9][0-5][0-9].*

Fails C:\UDM\TEST\OUT\LinuxSystem.D2017201033.T235159.* month 20 day 33!

C:\UDM\TEST\OUT\LinuxSystem.[D][1-9][1-9][0-1][0-9][0-3][0-9][.][T][0-2][0-9][0-5][0-9][0-5][0-9].*

Fails C:\UDM\TEST\OUT\LinuxSystem.D171001.T266159.* hour 26 minutes 61!