I have the set
set1={'*klj?', 'bl:VOLTe?', 'abkjld:Sure:STe?', 'JKLJS?', 'TRered[:AMide]?', 'DKJ[:dkja]?'}
I want to have the set look like
set1={'*klj?', 'bl:VOLTe?', 'abkjld:Sure:STe?', 'JKLJS?', 'TRered?','DKJ?'}
where I want to get rid of the [:AMide]
and [:dkja]
inside the set.
I was trying to use regex
What I have so far is
set2={}
for element in set:
x=re.sub("([\(\[]).*?([\)\]])", "", str(element))
set2.add(x)
This gets rid of the [] and what is inside but doesn't properly recreate the set, ie set2.add(x)
doesn't work