Re: + in regular expression

Discussion in 'Python' started by Ian Kelly, Oct 5, 2012.

  1. Ian Kelly

    Ian Kelly Guest

    On Thu, Oct 4, 2012 at 9:44 PM, Saroo Jain <> 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.
     
    Ian Kelly, Oct 5, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Keith-Earl
    Replies:
    1
    Views:
    463
    Mary Chipman
    Jun 15, 2004
  2. VSK
    Replies:
    2
    Views:
    2,335
  3. =?iso-8859-1?B?bW9vcJk=?=

    Matching abitrary expression in a regular expression

    =?iso-8859-1?B?bW9vcJk=?=, Dec 1, 2005, in forum: Java
    Replies:
    8
    Views:
    863
    Alan Moore
    Dec 2, 2005
  4. GIMME
    Replies:
    3
    Views:
    11,997
    vforvikash
    Dec 29, 2008
  5. Noman Shapiro
    Replies:
    0
    Views:
    240
    Noman Shapiro
    Jul 17, 2013
Loading...

Share This Page