I have used /(?<=BAY )[0-9]/g in my regex test app and (?<=BAY )[0-9] in another app that I use to do regex extractions to get the BAY value and /(?<=DRIVER )[0-9]*\/[0-9]*/g and (?<=DRIVER )[0-9]*\/[0-9]* to get the DRIVER value.
The first expression completes in KNIME with no errors but creates no results.
The second expression creates a new column, split_0, but generates an error message = 535 input string(s) did not match the pattern or contained more groups than expected.
I tried as Richards99 suggested and put a .* before and after the expression but still got no results. I then followed aborg's link to http://regex101.com and tested the expressions online and they worked perfectly (I even managed to tune them a bit while I was there) but still no errors or results in KNIME.
I would really appreciate any other possible suggesttions.
You could use the "Cell Splitter" Node and enter space as the delimiter. You would have your bay information in Arr[0] and your driver information in Arr[6]. You could then use "column filter" node to get rid of the other columns. Using the string manipulator node to get rid of the semi colon and commas if needed.
I am pretty new user and couldn’t solve a problem akin to this topic:
I could fix it in jupyter notebook so I will share the exact example:
data = pd.DataFrame( {'country':['France', 'Japan', 'England'],
'Inspection Interval' :['Residential 5 years commercial 2 years Mean stok age 30.1',
'Residential 4 Commercial 1 year Mean age 25.2',
'Residential proposed 10 years commercial adfs 15 year MSA 22.0']
})
data['Numbers']=0
for i in range(data.size):
data['Numbers'][i]=re.findall('\d*\S*\d+', data['Inspection Interval'][i])