Sujet : Re: Correct syntax for pathological re.search()
De : Karsten.Hilbert (at) *nospam* gmx.net (Karsten Hilbert)
Groupes : comp.lang.pythonDate : 08. Oct 2024, 20:30:34
Autres entêtes
Message-ID : <mailman.7.1728412237.4695.python-list@python.org>
References : 1 2
Am Mon, Oct 07, 2024 at 08:35:32AM -0500 schrieb Michael F. Stemper via Python-list:
I'm trying to discard lines that include the string "\sout{" (which is TeX, for
those who are curious. I have tried:
if not re.search("\sout{", line):
if not re.search("\sout\{", line):
if not re.search("\sout{", line):
if not re.search("\sout\{", line):
unwanted_tex = '\sout{'
if unwanted_tex not in line: do_something_with_libreoffice()
Karsten
-- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B