Search code examples
javawildcardtalend

TALEND tMap - how to use wildcard in string match?


I have a TALEND ETL job which I'm trying to modify slightly.

In one of the tMap I have an expression like this:

row.regulation.equals("Reg200806.s3.2a") || row.regulation.equals("Reg200806.s3.2b")

Is there a way to make this match any string ending in '.2a' or '.2b'. I'm guessing that I can wildcard like how % works in SQL. Does anyone know what is the correct wildcard to use in TALEND? (I believe that is is all java under the hood)

Thanks JP


Solution

  • Yes you can use java expression in Talend to achieve this. use below expression and test whether it works or not.

    row.regulation.endsWith(".2a") || row.regulation.endsWith(".2b")