Regex for Column Filter Numbers


Don’t laugh, but I’ve literally spent 2+ hours trying to figure this out so I’m giving up and asking for help.

My prediction columns are labeled “P (Target=Buy) (#1)” and then “P (Target=Buy) (#2)” , etc (they don’t actually have the quotes). What is the regex pattern to filter by “#1” , #2, #3 etc…?

Thank you in advance.


I’m not totally sure about requirement.
If I assume that you would to filter for “P (Target=Buy) (#1)” and get this column as result.
So you may use the Column Filter Node.
According to my knowledge using something like


as the regex to select the column should work.
Please do not forget to check regex selection below the regex itself.

When applying to the column filter node this works perfectly for me.


I should have had a look to the regex before posting. This regex will obviously not bring the correct result, the brackets will return just a part of the input string
Apologise for this stupid Copy&Paste error.

The correct regex is


Unfortunately I’m not able to correkt my first post.

Hello @cybrkup,

seems to me wildcard approach is sufficient here:

P *

If you really what to use regex to get column which have “#d+” (be careful as you might have columns with that pattern which are not prediction columns) use following regex:



Thanks all, I got it.

I should have clarified my original post in that I need to filter in a loop. i.e. Loop 1 I’m looking for columns with “1” in the name, etc. I tweaked Ivan’s answer to do this, so for loop 1 the regex is:

for loop 2 it is:

Thanks again for the guidance.

1 Like

Hello @cybrkup,

glad you found a way. Only exclude + from regex as it will include P (Target=Buy) (#11) in first iteration in case you have that many columns.


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