Correct syntax for pathological re.search()

Karsten Hilbert Karsten.Hilbert at gmx.net
Tue Oct 8 16:17:49 EDT 2024


Am Tue, Oct 08, 2024 at 08:07:04PM +0100 schrieb MRAB via Python-list:

> >unwanted_tex = '\sout{'
> >if unwanted_tex not in line: do_something_with_libreoffice()
> >
> That should be:
>
>     unwanted_tex = r'\sout{'

Hm.

	Python 3.11.2 (main, Aug 26 2024, 07:20:54) [GCC 12.2.0] on linux
	Type "help", "copyright", "credits" or "license" for more information.
	>>> tex = '\sout{'
	>>> tex
	'\\sout{'
	>>>

Am I missing something ?

Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B


More information about the Python-list mailing list