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

string  = "Longan"
pattern = r"^."
flags   = 0 # re.DOTALL | re.MULTILINE

compiled = re.compile( pattern, flags )
for m in compiled.finditer( string, 0 ):
    print repr( m.group() ),
    print "from %d to %d" % m.span(),
    print "with groups: %s" % str( m.groups() ) 

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