Re: Re: + in regular expression

Discussion in 'Python' started by Evan Driscoll, Oct 5, 2012.

  1. On 10/04/2012 04:59 PM, Mark Lawrence wrote:
    >> why the "\s{6}+" is not a regular pattern?
    >>
    >>
    >>

    >
    >
    > Why are you too lazy to do any research before posting a question?
    >

    Errr... what?

    I'm only somewhat familiar with the extra stuff that languages provide
    in their regexs beyond true regular expressions and simple extensions,
    but I was surprised to see the question because I too would have
    expected that to work. (And match any sequence of whitespace characters
    whose length is a multiple of six.) I reskimmed the documentation of the
    re module and didn't see anything that would prohibit it. I looked at
    several of the results of a Google search for the multiple repeat error,
    and didn't really find any explanation beyond "because you can't do it"
    or "here's a regex that works." (Well, OK, I did see a mention of +
    being a possessive quantifier which Python doesn't support. But that
    still doesn't explain why my expectation isn't what happened.)

    In what way is that an unreasonable question?

    Evan
     
    Evan Driscoll, 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:
    457
    Mary Chipman
    Jun 15, 2004
  2. VSK
    Replies:
    2
    Views:
    2,307
  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:
    851
    Alan Moore
    Dec 2, 2005
  4. GIMME
    Replies:
    3
    Views:
    11,974
    vforvikash
    Dec 29, 2008
  5. Noman Shapiro
    Replies:
    0
    Views:
    235
    Noman Shapiro
    Jul 17, 2013
Loading...

Share This Page