utilizes columnar pattern matching to identify data patterns of interest to you and to surface them in the interface for use in building your recipes. Additionally, in your recipe steps, you can apply regular expressions or  to locate patterns and transform the matching data in your datasets.

Overview

pattern is a combination of abstracted character sets and literal characters that can summarize data patterns in a column. Patterns can be applied through one of two methods:

This section provides an overview of the pattern matching features of the platform.

Example Patterns

Within a row, multiple patterns may be applied at different levels of abstraction to describe the data in all fields (columns) of the row. Suppose you have two records like the following:

[cz.laping@gmail.com,3987,1446319063821]
[ajuneauk@gmail.com,5289,1447275151508]

The above records can be described by any of the following patterns:

[{alpha-numeric}+,{4-digits},{13-digits}]
[{email},{4-digits},{13-digits}]
[{alpha-numeric}+@gmail.com,{4-digits},{13-digits}]

NOTE: The above patterns utilize the syntax of . Regular expressions can be used to describe them as well.

In the above case, all three pattern sets capture the data completely. However, please note the differences between the patterns for column 1:

PatternDescription
{alpha-numeric}+This pattern captures alpha-numeric values of one or more characters. So, entries that match on this pattern do not need to be valid email addresses.
{email}This pattern ensures matching only on valid email addresses. So, values that do not match this pattern are likely to be flagged as mismatched within the platform.
{alpha-numeric}+@gmail.comThis partial pattern ensures that the only matches are from gmail.com.

Depending on the specific meaning of the data for your use, any of the above may apply.

Patterns in the Platform

Column Profiling

Pattern matching applied to columns can permit users to see the most common patterns and anomalous patterns of data in a column across the entire sample. Since patterns presented to the user encompass the entire set of values in the sample, you can gather detailed information about the consistency of data in the column across the column. 

Tip: Column pattern profiling is especially useful after you have addressed the mismatched values in the column.

Based on the patterns surfaced for the column, you can take any of the following actions:

Machine Learning

Additionally,  collects aggregated information about patterns applied by all users. These patterns are given weight in the set of suggested patterns presented to each user. 

Pattern Matching by Data Type

As part of pattern matching, the platform evaluates the data against the specified data type for the column. Type-specific pattern matching applies to the following data types:

See Standardize Non-Numeric Values.

Using Patterns

In the application, patterns can be used as the starting point in building your next recipe step, and you can modify or iterate on a pattern definition to preview the results of the specified transformation. Patterns are used in the following actions:

Selecting Data

When you select a value in the data grid, your options include pattern-based suggestions. In this manner, you indicate something of interest and enable the platform to interpret your specific interest or broader goal for the selected data. These broader changes are surfaced as pattern-based suggestions in the context panel. 

 

Browse Pattern History

In fields in the Transform Builder that accept patterns, you can choose to review and select patterns from your recent history:

Browse Pattern History to review and select recently used patterns

A recently used pattern can be selected and added to the configured recipe step. See Pattern History Panel.

Patterns in Column Details

In the Column Details panel, you can review sets of patterns that describe subsets of the values in the column. When you select one of the patterns, you are prompted with a set of suggested transform steps to apply to the data. See Column Details Panel.

Advanced Uses

In addition to the above basic uses, patterns can be used as the basis for the following advanced uses and more.

UseDescription
Standardize recordsMatch values based on a pattern and then change values to fit this pattern. See Standardize Non-Numeric Values.
Filter recordsKeep or delete records based on patterns of values found in row data. See Filter Data.
Extract valuesExtract values matching a pattern from one column and insert them into a new column of data. See Extract Values.
Generate function outputsUse patterns to generate function outputs in new columns.

User-Defined Patterns

In your recipe steps, you can specify patterns using either of the following methods.

Regular expressions

Regular expressions (regexes) are sequence of characters that can be used to define a pattern. This pattern can be used in the transformations that support regex to identify patterns in your data of interest to you. Example:

replace col: myCol with:/$1/ on:/^\((\d\d\d)\)/ global: false

In the above step, the matching pattern expressed in the on clause evaluates in the following manner:

So, the net effect is to search the beginning of a field for values like (555) and replace them with just the digits: 555. This replacement removes the parentheses from the area code part of a phone number.

 

NOTE: Regular expressions are very powerful tools for matching patterns. They can also cause unexpected results. Use of regular expressions is considered a developer-level skill. You should use the described below instead.

 implements a version of regular expressions based off of RE2 and PCRE regular expressions.

Use  to quickly assemble sophisticated patterns to match in your data. The following example includes the equivalent  as the previous regular expression:

replace col: myCol with:`$1` on:`^\(({digit}{3})\)` global: false

For more information, see Text Matching.