A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2000-August/009021.html below:

[Python-Dev] one last SRE headache

[Python-Dev] one last SRE headacheFredrik Lundh Fredrik Lundh" <effbot@telia.com
Thu, 31 Aug 2000 21:46:54 +0200
can anyone tell me how Perl treats this pattern?

    r'((((((((((a))))))))))\41'

in SRE, this is currently a couple of nested groups, surrounding
a single literal, followed by a back reference to the fourth group,
followed by a literal "1" (since there are less than 41 groups)

in PRE, it turns out that this is a syntax error; there's no group 41.

however, this test appears in the test suite under the section "all
test from perl", but they're commented out:

# Python does not have the same rules for \\41 so this is a syntax error
#    ('((((((((((a))))))))))\\41', 'aa', FAIL),
#    ('((((((((((a))))))))))\\41', 'a!', SUCCEED, 'found', 'a!'),

if I understand this correctly, Perl treats as an *octal* escape
(chr(041) == "!").

now, should I emulate PRE, Perl, or leave it as it is...

</F>

PS. in case anyone wondered why I haven't seen this before, it's
because I just discovered that the test suite masks syntax errors
under some circumstances...




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