After python3.3, The multiline Regular Expression matching seems to have been modified. It cannot match a multi-line regular expression with non-escape characters.
The following error is reported:
>>>
Traceback (most recent call last ):
File" ", Line 420, in run_nodebug
File" <模块1> ", Line 48, in
File" <模块1> ", Line 31, in main
File "C: \ Python33 \ lib \ re. py", line 214, in compile
Return _ compile (pattern, flags)
File "C: \ Python33 \ lib \ re. py", line 281, in _ compile
P = sre_compile.compile (pattern, flags)
File "C: \ Python33 \ lib \ sre_compile.py", line 498, in compile
Code = _ code (p, flags)
File "C: \ Python33 \ lib \ sre_compile.py", line 483, in _ code
_ Compile (code, p. data, flags)
File "C: \ Python33 \ lib \ sre_compile.py", line 75, in _ compile
Elif _ simple (av) and op is not REPEAT:
File "C: \ Python33 \ lib \ sre_compile.py", line 362, in _ simple
Raise error ("nothing to repeat ")
Sre_constants.error: nothing to repeat
>>>
As prompted, we need to modify the value assignment of locatestarttagend_tolerant in row 56th of the "C: \ Python33 \ Lib \ html \ parser. py" file.
The modification method is to convert the original multi-line escape character into one line.
<喎?http: www.bkjia.com kf ware vc " target="_blank" class="keylink"> VcD4KPHByZSBjbGFzcz0 = "brush: java;" >## locatestarttagend_tolerant = re. compile (r "##< [a-zA-Z] [-. a-zA-Z0-9: _] * # tag name ##(? : [\ S/] * # optional whitespace before attribute name ##(? :(? <= ['"\ S/]) [^ \ s/>] [^ \ s/=>] * # attribute name ##(? : \ S * = + \ s * # value indicator ##(? : '[^'] * '# LITA-enclosed value ##| "[^"] * "# encryption-enclosed value ##| (?! ['"]) [^> \ S] * # bare value ##)##(? : \ S *,) * # possibly followed by a comma ##)? (? : \ S |/(?!> )) *##)*##)? ##\ S * # trailing whitespace # "", re. VERBOSE) locatestarttagend_tolerant = re. compile (r "\ n <[a-zA-Z] [-. a-zA-Z0-9: _] * # tag name \ n (? : [\ S/] * # optional whitespace before attribute name \ n (? :(? <= ['"\ S/]) [^ \ s/>] [^ \ s/=>] * # attribute name \ n (? : \ S * = + \ s * # value indicator \ n (? : '[^'] * '# LITA-enclosed value \ n | "[^"] * "# encryption-enclosed value \ n | (?! ['"]) [^> \ S] * # bare value \ n) \ n (? : \ S *,) * # possibly followed by a comma \ n )? (? : \ S |/(?!> )) * \ N )? \ N \ s * # trailing whitespace \ n ", re. VERBOSE)
I have a problem with the incorrect understanding. It should be due to the regular expression writing problem. It's late, and another day is working on it.