split problem
Fredrik Lundh
fredrik at effbot.org
Sun Nov 12 04:51:55 EST 2000
More information about the Python-list mailing list
Sun Nov 12 04:51:55 EST 2000
- Previous message (by thread): split problem
- Next message (by thread): Changing proxies with urllib
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"yasho" wrote:
> The splitting is made in a loop so I am splitting the string into
> several parts. For example I have a string which in this particular case
> I must split into five parts but when I split it into 3 parts I get this
> error :
> File "convert.py", line 16 in?
> c=re.compile(svalue.group()).split(s,1)
> File ".........../re.py", line 79, in compile
> code=pcre_compile(pattern, flags, groupindex)
> pcre.error:('nothing to repeat',0)
> Does anybody knows what is happening with my script?
the error message ("nothing to repeat") means that your
regular expression is flawed.
printing svalue.group() just before the re.compile call
should help you figure out what's wrong.
:::
also note that you can replace re.compile(p).split(s, ...)
with re.split(p, s, ...)
</F>
- Previous message (by thread): split problem
- Next message (by thread): Changing proxies with urllib
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list