68 views

regex in Pentaho

Today , I will discuss about the Regular expression in Pentaho.
Below are regex which can be used in Pentaho. There are many more as well. I worked on below Regex , so, I mentioned only those which I have used in the code.

  • The values having only digits : ^[0-9]+$
  • The values having only lowercase characters : ^[a-z]+$
  • The values having only uppercase characters : ^[A-Z]+$
  • The values having only uppercase & lowercase characters : ^[a-z|A-Z]+$
  • The value having list of vowels characters ^[AEIOU]+$
  • The value having only these characters : ^[ -~]+$

I have designed ETL code for the same.

See the below SS for Table input and Filter rows.


If you see clearly, I have used “REGEXP” in filter rows component. If value in var1 variable having only digits from 0 to 9, then it will go to success Path else failure Path. As per the value in the table input , it will go to the success path.

Execute the job now. See the logs below.
Write to log.0 – ————> Linenr 1——————————
Write to log.0 – TRUE CASE
Write to log.0 –
Write to log.0 – var1 = 123
Write to log.0 –
Write to log.0 – ====================

Second Scenario is when the value of var1 : 123F, then filter rows gets failed. See the logs for the same.
Write to log 2.0 – ————> Linenr 1——————————
Write to log 2.0 – FALSE CASE
Write to log 2.0 –
Write to log 2.0 – var1 = 123F
Write to log 2.0 –
Write to log 2.0 – ====================


Related posts