Show only data in specific format

Hi, I’m a new knime user and I’m kind of stuck.

I need only the data that are exact 9characters long and have the following format
ABC-0123-000
I tried to use string manupilation but then I get everything that have max 9 characters.

Hoping someone can help me

Hi,
Welcome to the KNIME Forum!
Do you mean you want to keep only the rows that have data in this format in a specific column? In that case you can use the Row Filter node. It has a “Pattern” field where you can specify a regular expression. That is a special expression that describes how a string should look like. In your case: 3 uppercase letters, a dash, then 4 digits, another dash, then 3 digits can be expressed as:

[A-Z]{3}\-[0-9]{4}\-[0-9]{3}

You can use a tool like the fantastic regex101.com to try out your patterns and learn more about regular expressions.
Kind regards,
Alexander

4 Likes

IT WORKS ! Thank you Alexander for the help and the tip.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.