I need to translate this regular expression to the python language:
(([[:alpha:]]|\.)*/PERSON([[:space:]]|$))+
I have a .txt file that contains names of people with the /PERSON tag and other words that do not have tags.
Leo/PERSON Messi/PERSON hello
Once you make the equivalent program in python to the regular expression above, the output must be this (all names with the label /PERSON, the other words are not):
Leo/PERSON Messi/PERSON
(?:[a-zA-Z.]*/PERSON(?:\s|$))+
? Took me 2 minutes. Check out regex101.com – ctwheels Dec 27 '17 at 19:29