Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #30775
| Date | 2012-10-04 21:25 -0500 |
|---|---|
| From | Evan Driscoll <driscoll@cs.wisc.edu> |
| Subject | Re: Re: + in regular expression |
| References | <CA+YdQ_4qK+UGjxpuzjsg3rVQfcQVLPgPB1SqP6Y+REa=OB8ZYQ@mail.gmail.com> <k4l0nq$udn$1@ger.gmane.org> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.1833.1349404871.27098.python-list@python.org> (permalink) |
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
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Re: + in regular expression Evan Driscoll <driscoll@cs.wisc.edu> - 2012-10-04 21:25 -0500
csiph-web