# Escape character in LaTeX

I need to output the below text but since \ is a special character, I cannot:

[RegularExpression(@"\d+")]


Also sometimes I need use dollar sign $ as well but it seems to be a special char, too. What is the way to escape those in LaTeX? UPDATE: I used \verb as suggested but I am unable to run commands inside it. Also, in the output the font and the opacity of the text is different than the default one: \verb|[RegularExpression(\newline @"\d+")]|  - – Marco W. Oct 10 '13 at 0:09 ## 3 Answers (This is fairly basic stuff, but perhaps it's worth repeating it.) The following ten characters have special meanings in (La)TeX: & % $ # _ { } ~ ^ \

Outside \verb, the first seven of them can be typeset by prepending a backslash; for the other three, use the macros \textasciitilde, \textasciicircum, and \textbackslash.

\documentclass{article}

\begin{document}



into this:

\& \% \$\# \_ \{ \} \texttt{\~{}} \^{}$\backslash\backslash\$today

-