- while (regex_replace(t, t, "^\\\\(emph|textbf|subsubsection|subsection|section|subparagraph|paragraph|part)\\*?\\{", "")
- || regex_replace(t, t, "^\\$", "")
- || regex_replace(t, t, "^\\\\\\[ ", "")
- || regex_replace(t, t, "^\\\\item ", "")
- || regex_replace(t, t, "^\\\\begin\\{[a-zA-Z_]*\\*?\\} ", ""))
+ while (regex_replace(t, t, REGEX_BOS "\\\\(emph|textbf|subsubsection|subsection|section|subparagraph|paragraph|part)\\*?\\{", "")
+ || regex_replace(t, t, REGEX_BOS "\\$", "")
+ || regex_replace(t, t, REGEX_BOS "\\\\\\[ ", "")
+ || regex_replace(t, t, REGEX_BOS "\\\\item ", "")
+ || regex_replace(t, t, REGEX_BOS "\\\\begin\\{[a-zA-Z_]*\\*?\\} ", ""))