this was the question on my exam the other day
Which strings does regular expression r"^([^aeiou]\w)+\1$" recognize? (3 answers)
"o_o-o_"
"baraba"
"ananas"
"anasan"
"-O->-O"
"izgriz"
im not into re at all :D, I tried to compile that expression and check for every string.. funny thing was that none was recognized..
so, my mistake or was there mistake in question?
from re import *
a=compile(r"^([^aeiou]\w)+\1$")
list=["o_o-o_", "baraba", "ananas", "anasan", "-O->-O", "izgriz"]
for string in list:
x=a.match(string)
if x:
print "ok"
else:
print "no"