On 16.03.16 08:34, Glenn Linderman wrote: > From the PEP 263: > >> More precisely, the first or second line must match the regular >> expression "coding[:=]\s*([-\w.]+)". The first group of this >> expression is then interpreted as encoding name. If the encoding >> is unknown to Python, an error is raised during compilation. There >> must not be any Python statement on the line that contains the >> encoding declaration. > > Clearly the regular expression would only match the first of multiple > cookies on the same line, so the first one should always win... but > there should only be one, from the first PEP quote "a magic comment". "The first group of this expression" means the first regular expression group. Only the part between parenthesis "([-\w.]+)" is interpreted as encoding name, not all expression.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4