Compte Gmail
Compte Gmail

Reputation: 137

How to verify if a string contains at least two numbers in Talend?

Does anybody know how to verify if a string contains at least two numbers in Talend using the Tmap component?

Example: The string "46 W Street, New York, NY 10033" is true since I have "46" and "10033"

Upvotes: 0

Views: 817

Answers (2)

Amine Ben Khelifa
Amine Ben Khelifa

Reputation: 765

In the var section : - Declare a variable called checkNumber that have type a boolean

That have as value

row1.YourString.matches(".*\\d.*") ? true : false

Upvotes: 1

Joshua
Joshua

Reputation: 61

I think i found how to do what you want, you can go to the java api link :https://docs.oracle.com/javase/7/docs/api/java/lang/String.html here you can find the contains methode wich return a boolean if there are the characters.

Upvotes: 0

Related Questions