On 2024-10-08 19:30, Karsten Hilbert via Python-list wrote:
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()

That should be:

    unwanted_tex = r'\sout{'

or:

    unwanted_tex = '\\sout{'

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to