# too many curly brace using verbdef

I would like to create an inline verbatim text for a regular expression. The verbdef package does not like when I put curly braces into its second argument. I tried with escaping backslashes but that did not work.

\documentclass{article}

\usepackage{verbdef}
\verbdef{\re2}{([^/]*/){3}}

\begin{document}

What is the meaning of the \re2 regular expression?

\end{document}


I got the following error message:

(/usr/share/texmf/tex/latex/ltxmisc/verbdef.sty)

! Too many }'s.

l.4 \verbdef{\re2}{([^/]*/){3}}

I looked for a long name of curly brace like \curlybraceleft but did not find one.

How can I solve this typesetting problem?

-
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces or enclose words in backticks , they'll be marked as code, as can be seen in my edit. You can also highlight the code and click the "code" button (with "{}" on it). –  zeroth Mar 17 '13 at 18:55
Thanks, both the welcoming and the typesetting tip. And the edit. –  Gergely Mar 17 '13 at 18:59
You are welcome, please edit the question adding where the \begin{document} should be placed, I am not familiar with the verbdef package and whether \verbdef must only be called in the preamble? :) –  zeroth Mar 17 '13 at 19:06
Thanks, egreg, it made it work. –  Gergely Mar 17 '13 at 19:15
zeroth, I made a minimal example that showed the error message and the problem. When you want to use that inline verbatim text, you simply use the \re macro that was being defined in the preamble. –  Gergely Mar 17 '13 at 19:18

The documentation of verbdef is indeed rather scanty. Your attempt has two issues.
Second issue: if the text to be stored verbatim has braces in it, you have to use a syntax like the ordinary \verb command, so for instance
\verbdef{\re}|([^/]*/){3}|

where the delimiter character (here |`) does not appear in the verbatim text.