On Thu, Oct 4, 2012 at 9:44 PM, Saroo Jain <Saroo_Jain at infosys.com> wrote: > x3=re.match("\s{6}+",str) > > instead use > x3=re.match("\s{6,}",str) > > This serves the purpose. And also give some food for thought for why the first one throws an error. That matches six or more spaces, not multiples of six spaces.