# tPatternExtract

Outputs all data that match a given pattern. You can then implement any required operation on the extracted data.

The tPatternExtract extracts from a column all data strings that match a given Java regular expression.

This component is not shipped with your Talend Studio by default. You need to install it using the Feature Manager. For more information, see [Installing features using the Feature Manager](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/install-features-to-talend-studio).

## tPatternExtract Standard properties

These properties are used to configure tPatternExtract running in the Standard Job framework.

The Standard tPatternExtract component belongs to the Data Quality family.

This component is available in Talend Data Management Platform, Talend Big Data Platform, Talend Real-Time Big Data Platform, Talend Data Services Platform and in Talend Data Fabric.

## Basic settings

| Properties | Description |
| --- | --- |
| Schema and Edit schema | <ul> <li> <p>A schema is a row description. It defines the number of fields            (columns) to be processed and passed on to the next component. When you create a Spark            Job, avoid the reserved word <kbd>line</kbd> when naming the            fields.</p> </li> <li> <p> <span>Built-In</span>: You create and store the schema locally for this component                only.</p> </li> <li> <p> <span>Repository</span>: You have already created the schema and stored it in the                Repository. You can reuse it in various projects and Job designs.</p> </li> </ul> |
| Column to check | Select the column you want to analyze. |
| PROPERTY | The pattern against which you want to check the data<br>is either Built-in or stored remotely in the<br>Repository.<br><br><ul> <li><span>Built-in</span>: You can enter a pattern regex in the                              <span>Pattern Regex</span> field and store it locally for                           this component only.</li> <li> <p><span>Repository</span>: From the <span>Pattern                                 Selector</span>, select the pattern against which you want to                              check the data.</p> <p><span>These patterns are retrieved from the                                    <span>DQ Repository</span> of <span>Talend Studio</span>.</span> The list includes the system and user-defined                              patterns.</p> </li> </ul> |

## Advanced settings

| Properties | Description |
| --- | --- |
| tStat<br>Catcher<br>Statistics | Select this check box to collect log data at<br>the component level. |

## Global Variables

| Variables | Description |
| --- | --- |
| Global Variables | NB\_LINE: the number<br>of rows read by an input component or transferred to an output component. This is an<br>After variable and it returns an integer.<br><br><br>NB\_LINE\_OK: the number of rows matching a given<br>pattern. This is an After variable and it returns an integer.<br><br><br>NB\_LINE\_REJECT:<br>the number of rows not matching a given pattern. This is an After variable and it<br>returns an integer.<br><br><br>ERROR\_MESSAGE: the error message generated by the<br>component when an error occurs. This is an After variable and it returns a string. This<br>variable functions only if the Die on error checkbox is<br>cleared, if the component has this checkbox.<br><br>A Flow variable functions during the execution of a component<br>while an After variable functions after the execution of the component.<br><br>To fill up a field or expression with a variable, press Ctrl+Space to access the variable list and choose the variable to use from<br>it.<br><br>For more information about variables, see [Using contexts and variables](https://help.qlik.com/talend/r/en-US/8.0/studio-user-guide/contexts-and-variables). |

## Usage

| Usage guidance | Description |
| --- | --- |
| **Usage rule** | This component is usually used as an intermediate component, and it requires an<br>input component and an output component. |
| Limitation | When exporting a Job using<br>tPatternExtract with a user-defined pattern<br>stored in the DQ Repository, you must export the<br>pattern with the Job. Otherwise, the pattern will switch to Built-in<br>mode when importing the Job in another project.<br><br>When importing a Job using tPatternExtract with a<br>system pattern, the pattern will switch to Built-in mode.<br><br>For more information about importing Jobs with<br>patterns in Talend Studio,<br>see Importing data profiling items or projects. |

**Related concepts**

* [Extracting only the data that corresponds to a defined pattern from a delimited file](https://help.qlik.com/talend/en-US/components/8.0/data-extraction/tpatternextract-tfiltercolumns-tfileinputdelimited-tfileoutputdelimited-extracting-only-data-that-corresponds-to-defined-pattern-from-delimited-file-standard-component-enterprise-this)