I want a string between (comma or whitespace) and a string.
The code I am using is
re.findall('[,]?[\s]*(.*?)[.]calc', string)
The output I get on running this
String 1 = "Select ID, Deliveryid.calc"
Result = Deliveryid
String 2 = "Select Deliveryid.calc"
Result = Select Deliveryid.calc
Now For string two I just want the Deliveryid and not the hole. Basically I want the string before ".calc" and "whitespace or comma". It can be anyone or both in the case of comma and whitespace
There can be a newline or tab also. Basically any type of whitespace along with the comma. Both can be present or anyone.
FYI - I want all the matching strings in the string. there can be one or many


[ .]([^ .]*)\.calc/[\s.]([^\s.]*)\.calc(demo)? Or simply[\s.](\w+)\.calc?(.*?)can match. Please clarify these points..instead of a,in the above comment. Still, the question remains.[\s,]([^\s,]*)\.calcenough? See demo.