Juan Manuel Macías <maciasch...@posteo.net> writes: >>> + (concat "\\(" >>> + (regexp-quote org-latex-line-break-safe) >>> + "\n\\)" >>> + "\\(^[ \t]*" >>> + (regexp-quote org-latex-line-break-safe) >>> + "\n" >>> + "\\)+") >>> + (concat "^[ \t]*" (regexp-quote org-latex-line-break-safe) >>> "$")) >> >> May also use rx for better readability. > > I remember that I tried rx a while ago and found it very useful and > comfortable, but then I haven't done anything with it. The fact is that > over time I have ended up getting used to suffering from the classic > regexp and it is hard for me to get out of there :-). Of course, with rx > it would be clearer but I would have to refresh my memory.
You can refer to [[info:elisp#Rx Constructs][elisp#Rx Constructs]] I think your regexp in rx should look like (rx-to-string `(seq (group ,org-latex-line-break-safe "\n") (1+ (group line-start (0+ space) ,org-latex-line-break "\n")))) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>