trouble with regex with escaped metachars (URGENT please O:-)

Fernando Rodriguez frr at easyjob.net
Thu Nov 20 12:00:21 EST 2003


On Thu, 20 Nov 2003 16:13:19 GMT, Roel Mathys <rm at rm.net> wrote:


>> I get this error:
>> Traceback (most recent call last):
>>   File "<pyshell#38>", line 1, in -toplevel-
>>     pat.sub(s,cts)
>>   File "C:\ARCHIV~1\python23\Lib\sre.py", line 257, in _subx
>>     template = _compile_repl(template, pattern)
>>   File "C:\ARCHIV~1\python23\Lib\sre.py", line 244, in _compile_repl
>>     raise error, v # invalid expression
>> error: bogus escape (end of line)
>> 
>> What on earth is this? O:-)
>
>it's the value of "value" that gives trouble (ending with a "bogus" \ 
>followed by an (invisible) end-of-line.
>This little patch will do the trick, and apparantly

But the final backslash is escaped, it shouldn't be a problem... :-(






More information about the Python-list mailing list