On 7 January 2013 15:38, Gora Mohanty <[email protected]> wrote:
> import re
> TITLE_RE = re.compile( r'#\n#([^\n]*)\n#\n \n\[([^\]]*)\]\n \n',
> re.MULTILINE|re.DOTALL )
> for m in TITLE_RE.finditer( s.strip ):
> title, info = m.groups()
> print title, info
Oops, that should be s.strip(), viz.,
import re
TITLE_RE = re.compile( r'#\n#([^\n]*)\n#\n \n\[([^\]]*)\]\n \n',
re.MULTILINE|re.DOTALL )
for m in TITLE_RE.finditer( s.strip() ):
title, info = m.groups()
print title, info
Regards,
Gora
_______________________________________________
BangPypers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/bangpypers