如何在LaTeX中包含大块正则表达式?

And*_*rew 2 regex formatting latex

是否可以包含一大块正则表达式(如下所示:http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html)而不首先转义所有碰撞字符?

我想到了类似的东西

\begin{following_section_will_not_be_parsed_by_latex}
(a+?b)
\end{...}
Run Code Online (Sandbox Code Playgroud)

And*_*rew 5

您可以包含\usepackage{listings}然后使用

\begin{lstlisting} [code|regex|whatever] \end{lstlisting}
Run Code Online (Sandbox Code Playgroud)