On Fri, Aug 14, 2009 at 5:23 PM, kj<no.em...@please.post> wrote: > >>>> import re >>>> re.split('^', 'spam\nham\neggs\n') > ['spam\nham\neggs\n'] >>>> re.split('(?m)^', 'spam\nham\neggs\n') > ['spam\nham\neggs\n'] >>>> bol_re = re.compile('^', re.M) >>>> bol_re.split('spam\nham\neggs\n') > ['spam\nham\neggs\n'] > > Am I doing something wrong? >
Maybe this: >>> import re >>> te = 'spam\nham\neggs\n' >>> pat = '\n' >>> re.split(pat,te) ['spam', 'ham', 'eggs', ''] -- Kind Regards -- http://mail.python.org/mailman/listinfo/python-list