Using Python 2.6.6, I'm trying to format each element in a list using regex.
Example of elements in an array:
test1;apple;-fgnsldfgsbfdgb
test2;watermelon;-iwerunvfgkjsfg
test3;orange;wervxddgjbdhnf
I'd like to format the text to just grab what is in between the semicolons ;
apple
watermelon
orange
The regex to capture that is the following:
(?<=\;)(.*?)(?=\;)
I tried different variations of the following code:
for member in fruits:
parseFruit = re.compile(member)
member = member.sub( (\.),((?<=\;)(.*?)(?=\;)) )
print("Fruit: ", member)
Nothing seems to work...