Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connections
Warning: mysqli::query(): Couldn't fetch mysqli in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\index.php on line 66
Article <mailman.29.1729537858.4695.python-list@python.org>
Deutsch   English   Français   Italiano  
<mailman.29.1729537858.4695.python-list@python.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: "Peter J. Holzer" <hjp-python@hjp.at>
Newsgroups: comp.lang.python
Subject: Re: Correct syntax for pathological re.search()
Date: Mon, 21 Oct 2024 21:10:49 +0200
Lines: 58
Message-ID: <mailman.29.1729537858.4695.python-list@python.org>
References: <ve0o34$1nep4$1@dont-email.me>
 <MQaOO.3313338$EVn.2054758@fx04.ams4>
 <011301db1c22$5e7519c0$1b5f4d40$@gmail.com>
 <20241012105958.cbctekv7vustleha@hjp.at>
 <966b510d-9bd7-4472-a858-7e042d78461d@tompassin.net>
 <20241018210941.f5azh2lvz7cxzcy5@hjp.at>
 <mailman.28.1729285790.4695.python-list@python.org>
 <veumlu$3gfsk$1@dont-email.me>
 <20241021191049.iclg7pmpfrpkel55@hjp.at>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol="application/pgp-signature"; boundary="xqh3xvxqda6sjljl"
X-Trace: news.uni-berlin.de DemUBJIHZCD+fxaR7Sp2xATiiJUZjTaMulZHKUflwlbw==
Cancel-Lock: sha1:vgA0P9EbkTWYR7rDpVBuLxpTDoI= sha256:MUGf+4IO4/FoNMS4+PyXGeF+yWug5y4Mcwi2rBsyfW8=
Return-Path: <hjp-python@hjp.at>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=none reason="no signature";
 dkim-adsp=none (unprotected policy); dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'content-
 type:multipart/signed': 0.05; 'string': 0.07; 'content-
 type:application/pgp-signature': 0.09; 'expression': 0.09;
 'filename:fname piece:asc': 0.09; 'filename:fname
 piece:signature': 0.09; 'filename:fname:signature.asc': 0.09;
 'graph': 0.09; 'trivial': 0.09; '"creative': 0.16; '+0200,': 0.16;
 '__/': 0.16; 'are.': 0.16; 'challenge!"': 0.16; 'expressions':
 0.16; 'from:addr:hjp-python': 0.16; 'from:addr:hjp.at': 0.16;
 'from:name:peter j. holzer': 0.16; 'hjp@hjp.at': 0.16; 'holzer':
 0.16; 'parsing': 0.16; 'reality.': 0.16; 'stross,': 0.16;
 'subject:syntax': 0.16; 'url-ip:212.17.106/24': 0.16; 'url-
 ip:212.17/16': 0.16; 'url:hjp': 0.16; '|_|_)': 0.16; 'wrote:':
 0.16; 'to:addr:python-list': 0.20; 'sense': 0.28; 'example,':
 0.28; 'python-list': 0.32; 'but': 0.32; 'subject:for': 0.33;
 'header:In-Reply-To:1': 0.34; 'yes,': 0.35; 'two': 0.39; 'match':
 0.40; 'both': 0.40; 'received:212': 0.62; 'between': 0.63; 'skip:r
 20': 0.64; 'similar': 0.65; 'received:userid': 0.66; 'time.':
 0.66; 'latin': 0.69; 'url-ip:212/8': 0.69; 'left': 0.83;
 'received:at': 0.84
Mail-Followup-To: python-list@python.org
Content-Disposition: inline
In-Reply-To: <veumlu$3gfsk$1@dont-email.me>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
 <python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
 <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
 <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <20241021191049.iclg7pmpfrpkel55@hjp.at>
X-Mailman-Original-References: <ve0o34$1nep4$1@dont-email.me>
 <MQaOO.3313338$EVn.2054758@fx04.ams4>
 <011301db1c22$5e7519c0$1b5f4d40$@gmail.com>
 <20241012105958.cbctekv7vustleha@hjp.at>
 <966b510d-9bd7-4472-a858-7e042d78461d@tompassin.net>
 <20241018210941.f5azh2lvz7cxzcy5@hjp.at>
 <mailman.28.1729285790.4695.python-list@python.org>
 <veumlu$3gfsk$1@dont-email.me>
Bytes: 5974


--xqh3xvxqda6sjljl
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2024-10-19 00:15:23 +0200, jak via Python-list wrote:
> Peter J. Holzer ha scritto:
> > As a trivial example, the regular expressions r"\\sout{" and r"\\sout\{"
> > are equivalent (the \ before the { is redundant). Yet
> > re.compile(s).pattern preserves the difference between the two strings.
>=20
> Allow me to be fussy: r"\\sout{" and r"\\sout\{" are similar but not
> equivalent.

They are. Both will match the 6 character string=20
    0005c \ REVERSE SOLIDUS
    00073 s LATIN SMALL LETTER S
    0006f o LATIN SMALL LETTER O
    00075 u LATIN SMALL LETTER U
    00074 t LATIN SMALL LETTER T
    0007b { LEFT CURLY BRACKET

> If you omit the backslash, the parser will have to determine if the
> graph is part of regular expression {n, m} and will take more time.

Yes, that's the parser. But the result of parsing will be the same:
The string will end in a literal backslash.

        hp

--=20
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

--xqh3xvxqda6sjljl
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmcWpzMACgkQ8g5IURL+
KF3MwA//U/od9Ba5s4anGCrIUm7uGFdaBVW7/SWr/xgGdJ2flTGfBnYPvVrK30yn
2B/GBBEn81clGhfvy2Ec7BHNl6Jz2bhe3kLzTAHCMANFXK4SwgNNM1lPLQe5MZr9
hWNUnl7fneAOmS6ySacAiI5L1cVtbWRy7D6/kjTcCdD1HdLMlY/hh6WA6Wxo/cfL
b12WvPToolCd1QozzoQxgHpvqMgYq9i0vfycgavB0OG2QQlAwD5KkYBfGKqoFGoo
X8TJqzH86Ofkln1RKKe+hixhvGU7Ce40H7UpECAMFMzJvXdaVzqHXCceY5f/ma0a
3PTKTia7df/1p3b47PXwDsaU3wTuAxexwNypHDn+FYmRHIjCX29oeANNOzC12/gI
ToLiitDTnwR9h3n0hKgxpL2GDkHQscoLkRJWSirzFaTzwI+u/X9OLP8xj9AlaWHm
WCtOisIJsva0JHoHKyG+Ycuqvgki0H4ZHc2MD3h7cx8hcodzNVI8OGFeBDpGCGqh
rFfTn6pb4hF3Oc5T5qN/+eZGHuYIOoRA7/JL0Ou3XpJi4iDSCRofkGMMpUzRYi9o
fa/EC9Hre0uG9j9fWlltpCcwjfnzOCPVn5Loqai2kaxJJhf7bNit5G97Lq4mCQi8
ZM0YwF+14JDKKD7gZ5qbqvEjF3ofdjMqNNoqwcSW7GObJdluQ/A=
=Aw/7
-----END PGP SIGNATURE-----

--xqh3xvxqda6sjljl--