Looking to extract string of numbers from messy column values
Hi,
I am new to KNIME and still learning how to achieve some results. I have a column of information that is very messy, no standardization to the formatting of the contents and contains values that are variable in length and format. This column contains number strings that I would like to have in a stand-alone column, removing all of the other information. These number strings are variable in length and may or may not contain punctuation or spaces and may have a letter as part of the string (often at the end). There may also be more than one in a given cell.
I have tried the String Manipulation node using the regexReplace function using an expression like this:“(.*\\d+(?:[.,\\s]\\d+)”,“$1” but no matter how I modify this regex, I can’t get KNIME to give me results. It either gives me nothing in the new column or it simply copies what is in the column to the new column.
Can anyone help me with either a better regex and/or node to achieve this goal of extracting the string of numbers? Below are some example strings where I would like to extract the numbers:
| 15449L Universal Editions |
| 144-40058 Merion Music, Inc. |
| 6718 Peters; 6718a Peters |
| eSp 8323 |
| 6378 Edition Schott |
| U.E. 12466 LW Universal |
| 66455 Edition Peters |
| Z. 7032 Editio Musica volume 1; Z. 7926 Editio Musica volume 2 |Thank you! |