Identifying the required regex expressions

The following information can help you identify required regex expressions.

About this task

Validate that the regular expressions that are required for the policy are present. You can create or modify them if necessary.

Procedure

  1. On the metadata page, select the Regular Expression tab.
    The list of available expressions displays.
    Figure 1. Preinstalled regular expressions
    Regular expressions screen
  2. Search through the list of regular expressions to find any that match the content to be searched.
    As shown in Figure 1, IBM Spectrum® Discover includes a selection of regular expressions.

    For example, an expression with an embedded value that might be extracted.

    ^([\w\.=-]+@[\w\.-]+\.[\w]{2,3})$
    This regular expression matches an email address, and the value that is returned for the tag is the matched email address. This sort of regex is appropriate to use in a value type match.

    Another example is an expression with no embedded value, for a straight match.

    ^Patient Name:.*$

    This expression detects the presence of the literal string “Patient Name:” and subsequent string in a fixed format file, but it does not extract the value. This is appropriate for use in a Boolean find search.

  3. If there are no suitable regular expressions, select the Create icon.
  4. If a regular expression exists but requires modifications select the expression and click the “Modify” icon. If this regular expression is in use by any other policy, this modification affects those policies.
  5. Enter a suitable name, description, and the regular expression pattern.
  6. Select Save.