[luatex] Library for regular expressions in lualatex

Harald Hanche-Olsen harald.hanche-olsen at ntnu.no
Mon Jun 10 19:12:11 CEST 2019


 
I can't help with finding a regexp library, but really, 
I think it is the wrong tool for the job.
Finding dollar signs in the input does not require the use of a regexp, for sure.
Your bigger problem is to do the right thing
in the presence of formulas spanning multiple lines, for example.
The possibility of inline math inside a \text{…} inside display math
complicates the job a bit. And regexps won't help you with these issues.

Que quote by Jamie Zawinski:
  Some people, when confronted with a problem,
  think "I know, I'll use regular expressions."
  Now they have two problems.

– Harald

From: Саша Козловский (mailto:k.sasha1994 at yandex.ru)
Reply: LuaTeX discussion. (mailto:luatex at tug.org)
Date: 10 June 2019 at 18:08:15
To: luatex at tug.org (mailto:luatex at tug.org)
Subject: [luatex] Library for regular expressions in lualatex

> Hello Everybody. I want in each formula replace all $$ on \[\] and $ on
> \(\) if before each $ it no char \,because it not exists any ways to
> override $ and $$ in lualatex. For example instead of formula $$a+b=c$$
> must be formula \[a+b=c\] and,for example,instead of formula $a-b=0$
> must be formula \(a-b=0\). All replacement i do in callback
> process_input_buffer. So i need in regexp,but lua in lualatex is not
> fully support regular expressions,so advice me please library,which use
> sintaksis of regular expressions like in python and which works in
> lualatex. Thanks everybody for the help.
>  




More information about the luatex mailing list