Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Created·2021-10-05 15:23
Updated·2021-10-05 16:16
Flavor·PCRE2 (PHP)

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

Description

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

Submitted by anonymous