Search code examples
javascriptregexpentahopentaho-spoonpentaho-data-integration

Break string into columns using Regular Expression


I am new in regex, i want to break the give string into 6 parts using regular expression. I am using the Pentaho data integration tool (ETL tool)

Given string: 1x 3.5 mL SST. 1x 4.0 mL gray cap cryovial.

Note: There are many more string with same format

I want output as: enter image description here

Thanks in advance !!


Solution

  • The single string datum you've given looks like it should match the regex pattern:

    (\d*)x\s(\d*\.\d*)\smL\s(.*)\.\s(\d*)x\s(\d*\.\d*)\smL\s(.*)\.
    

    You can use it with Regex Evaluation step:

    Regex Evaluation