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.
Procedure
-
In the DQ Repository tree view, expand and double-click the pattern you want to use to create your
customized pattern.
The pattern editor opens in Talend Studio.
-
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.
- Optional:
Enter a test string in the Test Area, to test the
regular expression.
-
Click Create Pattern to open the New Regex
pattern wizard.
-
In the Name field, enter a name for this new regular
expression.
Important:
Do not use the following special characters in the item names: ~ ! ` # ^ * & \\ / ? : ; \ , . ( ) ¥ ' " « » <
>
These characters are all replaced with "_" in the file system and you may end up
creating duplicate items.
-
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.
-
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 , expand Help and then select
Bookmarks.
-
From the Language Selection list, select the database in
which you want to use the new regular expression.
-
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.