Escaping regex is a heck of a work on LaTeX. How should I write in latex syntax such that I can output the following regexes:
^\(?\s?\w{1,5}\s*[):.]\s*
and
[\[\(].{1,}[\]\)]
I've tried \text{[\[\(].{1,}[\]\)]}
but it gives compilation errors.
Best Answer
You can use a verbatim (fancyvrb package) or listings environnement.