I have a text which can look like this:
36] Smarandache F. (Editor), Proceedings of the First International Conference on Neutrosophics, Univ. of New Mexico, Gallup Campus, NM, USA, 1-3 Dec. 2001, Xiquan, Phoenix, 2002
I want to extract:
Proceedings of the First International Conference on Neutrosophics
I have tried to use regex pattern as follows:
conference = re.search(",(.*)conference(.*),", str(r.lower()))
and I get only this as output: Proceedings of the First International
My text is going to be random but it will contain word like conference
My question is how can I develop pattern which can find word conference inside the text and extract the substring from first comma preceding the word conference to first comma after the word conference.
, xxxxxxxxxxxxxxxxxx conference xxxxxxxxxxxxxxxxxxx ,
Any help will be great
,(.*)conference(.*),to,(.*conference.*),and you'll see a group that has exactly what you want. You might want to do,(.*?conference.*?),to have non-greedy/lazy matches.