Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
PCRE2 (PHP >=7.3)

/
(\\begin{(.+atrix|.*rray|.*abular)}[^\\]*)( )*\v(\X*\\end{\g2})
/
gm

Description

This regex matches newlines in LaTeX matrices/arrays/tabulars and adds \ automatically.

Submitted by anonymous - 3 years ago (Last modified 3 years ago)