lines = str(text).split('\n')
where text = page.get()
str(abc) tries to make a bytestring of the text object. either use
text.split('\n')
or
unicode(text).split('\n')
The first would be the preferred syntax.
And for the regexp case: use ur'text' (or ru'text', I think it was ur'') instead of r''
--valhallasw