Creating a new pattern from the Pattern Test View - 7.1

Talend Real-time Big Data Platform Studio User Guide

author
Talend Documentation Team
EnrichVersion
7.1
EnrichProdName
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend Studio

You can create your own customized patterns from the Pattern Test View. The advantage of creating a pattern from this view is that you can create your customized pattern based on an already tested regular expression.

All you need to do is to customize the expression definition according to your needs before saving the new pattern.

Before you begin

You have selected the Profiling perspective of Talend Studio.

Procedure

  1. In the DQ Repository tree view, expand Libraries > Patterns > Regex and double-click the pattern you want to use to create your customized pattern.
    The pattern editor opens in Talend Studio.
  2. Click Test next to the definition you want to use as a base to create the new pattern.
    The Pattern Test View is opened on the definition of the selected regular expression.
  3. If required, test the regular expression through entering text in the Test Area. For further information, see Testing a regular expression in the Pattern Test View.
  4. Click Create Pattern to open the New Regex pattern wizard.
  5. In the Name field, enter a name for this new regular expression.
    Note:

    Avoid using special characters in the item names including:

    "~", "!", "`", "#", "^", "&", "*", "\\", "/", "?", ":", ";", "\"", ".", "(", ")", "'", "¥", "'", """, "«", "»", "<", ">".

    These characters are all replaced with "_" in the file system and you may end up creating duplicate items.

  6. If required, set other metadata (purpose, description and author name) in the corresponding fields and click Next to proceed to the next step.
    The definition of the initial regular expression is already listed in the Regular expression field.
  7. Customize the syntax of the initial regular expression according to your needs. The regular expression definition must be surrounded by single quotes.
    Note:

    For the PostgreSQL database, regular expressions are not compatible among the database different versions.

    If you want to use the regular expression with PostgreSQL version 9.1 or greater, you must either:
    • in the PostgreSQL database configuration, set the standard_conforming_strings parameter to off and write double backslashes in the definition, or
    • in the Regular expression field in the wizard, use a single backslash in the expression definition.

    For further information about PostgreSQL regular expressions, select Window > Show View, expand Help and then select Bookmarks.

  8. From the Language Selection list, select the database in which you want to use the new regular expression.
  9. Click Finish to close the wizard.

Results

A subfolder for the new pattern is listed under the Regex folder in the same file of the initial regular pattern. The pattern editor opens on the pattern metadata and pattern definition.