# l3regex usage throws __scan_new:N error

Using TeXLive, with this MWE

\documentclass{article}
\usepackage{expl3}
\usepackage{l3regex}
\begin{document}
a
\end{document}


I get an error for an undefined control sequence

(/usr/share/texlive/texmf-dist/tex/latex/l3experimental/l3str/l3tl-analysis.sty
Package: l3tl-analysis 2011/12/08 v3039 L3 Experimental token lists analysis
(/usr/share/texlive/texmf-dist/tex/latex/l3experimental/l3str/l3str.sty
Package: l3str 2013/04/24 v4482 L3 Experimental strings
)
! Undefined control sequence.

l.54 \__scan_new:N
\s__tl


I assume some incompatible (too old) L3 packages. However, the Debian packages word quite well in resolving dependencies in the past. Could you please assist me?

• As you observe, this is a version mismatch, but not the one you think it is! A quick look at the log I get here suggests to me that you've got an incorrect version of expl3 or part thereof. Could you add \listfiles to your input, miss out \usepackage{l3regex} and edit the *File list* from your log into the question? – Joseph Wright Nov 7 '13 at 8:07
• You might also look through the log to see where expl3 and the various l3... packages are loading from: my suspicion is that one or more is a 'local' file which is therefore out-of-sync with the main tree. – Joseph Wright Nov 7 '13 at 8:08
• Adding \listfiles pointed me to the problem. For some reason, there was a local texmf tree. Removing it solved the problem. Thanks, Joseph. – user39625 Nov 8 '13 at 7:44
• @user39625 In that case, I'll write up something as an answer – Joseph Wright Nov 8 '13 at 8:04

Package: l3tl-analysis 2011/12/08 v3039 L3 Experimental token lists analysis

are both 'matching' (there should be no issues with this combination). Thus the problem must lie elsewhere. As \__scan_new:N is not defined I think you have an older version of l3kernel installed which pre-dates the introduction of the 'scan mark' approach. Thus the solution will be to check your .log file carefully for where expl3 and the various component packages are loaded. They should all come from the same tree.