#!/usr/bin/env python
# Copyright 2014 Tomasz Wyderka <[email protected]>
##
import re

string  = "\nMango is yellow.\nBanana is rip.\n"
pattern = r"^.*$"
flags   = 0 # re.DOTALL | re.MULTILINE

for m in re.finditer( pattern, string, flags ):
    print repr( m.group() ),
    print "from %d to %d" % m.span()

print "String length: %d" % len(string)