ur'(?P<text>[^<#\n ].+?[^ ])(?=\n)

def t_TEXT(self, token):
        ur'(?P<text>[^<#\n ].+?[^ ])(?=\n)'
        text = token.lexer.lexmatch.group("text").decode("utf8")
        token.value = text
        return token