Regular Expression and Wildcard Modifiers

Regular expression and wildcard modifiers are supported for various properties where a text pattern search is enabled. The primary purpose for these modifiers is to add special rules to text comparison so that the Integration Service can execute a more precise search for the specified text pattern. Regular expression and wildcard modifiers differ from other special characters in that they are only used to modify text pattern search, so they do not end up being embedded in the processed data.

You can identify properties that support regular expression or wildcard modifiers by the appearance of the control to the right of the property. Click to view a list of supported regular expression or wildcard modifiers, and click the desired modifier to add it to the property.

On some property pages, you may need to enable the Use Regular Expression property to enable the control. On other property pages, you must select Use Wildcards (* and ?) or Use Regular Expression from the Search Method dropdown list to use this control.

ClosedExample: Regular Expression Modifiers

Suppose that all Print Command Script trigger files currently print to Zebra printers:

%BTW% /AF="MyFile.btw" /PRN=”Zebra (1)” /P

%END%

You have created a file integration using an existing Print Command Script trigger file, but want to redirect print jobs to Datamax printers. Instead of manually editing all of your trigger files to update the printer, you can add a “Search and Replace” action that searches for the “ZebraXXX” pattern and replaces it with “Datamax”.

You don’t need to use a regular expression modifier if the pattern is an exact match, such as “Zebra” to “Datamax”. However, if the printing criteria is more complex, a regular expression modifier may be necessary. In this example, the existing Print Command Script trigger files are printing to multiple printers, "Zebra (1)," "Zebra (2)," and "New Zebra." You want to redirect print jobs from only “Zebra (1)” and “Zebra (2)” to “Datamax”.

In this case, regular expression modifiers allow you to execute a more precise search.

ClosedTo add regular expression modifiers to a Search and Replace action

  1. In the Options section of the Search and Replace property page, select Use Regular Expression from the Search Method dropdown list.

  2. In the Search for box, type “Zebra”.

  3. Locate your cursor immediately after the letter "a".

  4. Click and select "." from the list of regular expression modifiers.

  5. Click again and select "*" from the list of regular expression modifiers.

The result is “Zebra.*” in the Search for box. This allows you to specify "Zebra" plus any characters that follow it until the double-quote character is reached:

  • The “.” character will match to any single character.

  • The “*” character will match 0 or more times.

By combining "." and "*" into “Zebra.*”, your search will match double-quote plus Zebra plus any number of trailing characters until the end double-quote is reached. When those instances are found in the trigger file, they will be replaced with “Datamax”.

ClosedExample: Wildcard Modifiers

A wildcard character can be used to substitute one or more characters in a string. The following procedure assumes the same scenario as described in the previous example, but the Search and Replace action uses wildcard modifiers.

ClosedTo add wildcard modifiers to a Search and Replace action

  1. In the Options section of the Search and Replace property page, select Use Wildcards (* and ?) from the Search Method dropdown list.

  2. In the Search for box, type “Zebra”.

  3. Locate your cursor immediately after the letter "a".

  4. Click and select "?" from the list of wildcard modifiers.

  5. Click again and select "*" from the list of wildcard modifiers.

The result is “Zebra?*” in the Search for box. This allows you to specify "Zebra" plus any characters that follow it.

Searching with wildcards is not as powerful a method as searching with regular expressions. Searching with wildcards may not result in an equivalent match.