Scenario: Checking the format of an e-mail address - 6.1

Talend Components Reference Guide

Version
6.1
Language
English (United States)
Product
Talend Big Data
Talend Big Data Platform
Talend Data Fabric
Talend Data Integration
Talend Data Management Platform
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for Big Data
Talend Open Studio for Data Integration
Talend Open Studio for Data Quality
Talend Open Studio for ESB
Talend Open Studio for MDM
Talend Real-Time Big Data Platform
Module
Talend Studio
Content
Data Governance
Data Quality and Preparation
Design and Development

This scenario uses two components, a tLibraryLoad and a tJava. The goal of this scenario is to check the format of an e-mail address and verify whether the format is valid or not.

Setting up the Job

  1. In the Palette, open the Custom_Code folder, and slide a tLibraryLoad and tJava component onto the workspace.

  2. Connect tLibraryLoad to tJava using a Trigger > OnSubjobOk link.

Configuring the tLibraryLoad component

  1. Double-click on tLibraryLoad to display its Basic settings. From the Library list, select jakarta-oro-2.0.8.jar.

  2. In the Import field of the Advanced settings tab, type import org.apache.oro.text.regex.*;

Configuring the tJava component

  1. Double-click on tJava to display its Component view.

  2. In the Basic settings tab, enter your code, as in the screenshot below. The code allows you to check whether the character string pertains to an e-mail address, based on the regular expression: "^[\\w_.-]+@[\\w_.-]+\\.[\\w]+$".

Job execution

Press F6 to save and run the Job.

The Console displays the boolean false. Hence, the e-mail address is not valid as the format is incorrect.