regex - Regular expression for LaTeX with escaped } (curly brace) needed -



regex - Regular expression for LaTeX with escaped } (curly brace) needed -

i started write c programme converting latex html code. best way in sentiment utilize regular expressions, yet cannot create simple thought work pcre: replace \term{abc} [pre]abc[/pre] (\term latex command of own). right here's catch:

how handle escaped curly braces (\}) in \term? how handle pairs {}? how create regular look greedy consumes first of many \term commands, not of them?

well, many questions figure out. hope can help?

ps: i'm sorry if, in case, have overlooked reply similar question...

see perlfaq6(1) "can utilize perl regular expressions match balanced text?". said, since latex's complexity seems similar (if not worse) (x)html, might want heed words of regex match open tags except xhtml self-contained tags .

regex latex pcre

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -