DataFlux Data Management Studio 2.7: User Guide

Adding and Editing Regex Libraries

Overview

Add a new regex library or update an existing library when the current libraries do not produce the output you desire. To understand regex libraries, see the help for the Regex Library Editor. See also the existing libraries on the Regex Library tab. For details about expression syntax, see Regular Expression Syntax in the Regex Library Editor.

Regular expressions will be applied sequentially in the order in which they appear in the regex library. It is possible that a value could be modified by one regular expression, and then the result of that modification could be modified again by a regular expression that appears further down in the library. This could occur several times as DataFlux Data Management Studio applies each regular expression from top to bottom. Be careful not to subvert the effects of one regular expression with another.

After creating or updating a regex library, you can use the Regex Library Editor to test your expressions. The Test Area at the bottom of the editor enables you to type sample input strings to verify that you have written your regular expressions correctly. Type an input string and observe the result. If the result is not what you intended, you can modify your regular expressions or their order and re-test. When you are satisfied with the results, save your changes.

Add a New Regex Library

Perform these steps to add a new regex library to a locale in a QKB. It is assumed that you have opened the QKB from the Administration Riser, and the Regex Libraries tab is displayed.

  1. Click the New Regex Library button on the lower toolbar, or select New Regex Library from the action menu on the lower toolbar. The New Regex Library wizard opens.
  2. Enter a name and description for the new library and click Next.
  3. Select a locale for the library and click Finish. The new library appears in the regex library list, and the Regex Library Editor opens.
  4. Add one or more expressions to the library.

    To add a new expression, select Edit > Add Expression.

    To edit, delete, or copy an expression in the editor, select an expression. Then select the appropriate option from the Edit menu. To paste a copied expression, select Edit > Paste Expression.

    To reorder expressions in the editor, select an expression and drag it to a new location.

  5. Use the Test Area of the editor to see the results of applying all expressions in the current regex library to a text string. Specify an input string and click Go to see the result.
  6. When you are satisfied with the results of your testing, save the library. If SAS Data Management Studio is open, you will be prompted to reload the QKB.
  7. Click Yes to reload the QKB.

Edit a Regex Library

It is usually best to copy an existing regex library and modify the copy, rather than modify the original. If you modify an existing library, you might break a QKB definition that uses that library.

Perform these steps to edit a regex library in a locale in a QKB. It is assumed that you have opened the QKB and locale from the Administration Riser, and the Regex Libraries tab is displayed.

  1. To open a regex library for editing, double-click on the library in the list, or select the library and click the Open icon on the lower toolbar. You might also select the library and choose Open in the context menu or in the action menu on the lower toolbar. The library opens in the Regex Library Editor.
  2. To add a new expression, select Edit > Add Expression.

    To edit, delete, or copy an expression in the editor, select an expression. Then select the appropriate option from the Edit menu. To paste a copied expression, select Edit > Paste Expression.

    To reorder expressions in the editor, select an expression and drag it to a new location.
  3. Use the Test Area of the editor to see the results of applying all expressions in the current regex library to a text string. Specify an input string and click Go to see the result.
  4. When you are satisfied with the results of your testing, save the library. If SAS Data Management Studio is open, you will be prompted to reload the QKB.
  5. Click Yes to reload the QKB.

Documentation Feedback: yourturn@sas.com
Note: Always include the Doc ID when providing documentation feedback.

Doc ID: DMCust_RegexLib_AddEdit.html