Hello All, new to KNIME and trying to solve the following:
I have a string from which I want to extract sub-strings that all begin with the same text in this example “hoi”. The amount of times that the text “hoi” appears can vary and the text between does not follow any logic. When the text “hoi” is encountered I want to pick up the text “hoi” and let’s say the next character at the right of the text “hoi” for that I first need to know what the position is of each of the “hoi” text in the string. A loop construction seems the logic solution that stops the moment that after the last “hoi” no further "hoi’ patterns in the text are found. Have been looking at loop examples and trying to get it working but by lacking experience I get stuck. Anybody out there having any bright ideas
I attached an example on how I search 4 times for “hoi” in the source string and 4 times pick up the next position in a variable. Of course this is not the solution as it is a fixed amount of runs, but it gives an idea on what the problem is that I want to solve.
Hi Ipazin, thanks for your post showing the power of regex ! The minus of this solution would be that you need to be sure about the frequence that "hoi"appears in the string that you are processing. Other solutions posted do not have that issue and as such a a bit more flexible. In the situation for which I’m building the KNIME solution that is a plus. But as said nice example of regex !