I have used this pattern (found on this site) many times to animate listings in beamer. Unfortunately, it does not work anymore.
This code comes from a solution to this issue : listings: highlight part of a delimited word starting with space
\documentclass{article}
\usepackage{listings,xparse}
\usepackage{expl3}
\usepackage{xcolor}
\definecolor{darkblue}{rgb}{0.0,0.0,0.6}
\colorlet{orangeb}{orange!80!black}
\def\noprint#1{}
\ExplSyntaxOn
\NewDocumentCommand \namespaces { }
{
\tl_set:No \l_demo_tl {\the\use:c{lst@token}}
\regex_replace_all:nnN { ([a-zA-Z]):([a-zA-Z]) } { \c{textcolor}\cB{ orangeb \cE}\cB{ \1 \cE}:\c{textcolor}\cB{ darkblue \cE}\cB{ \2 \cE} } \l_demo_tl
\tl_use:N \l_demo_tl
\noprint
}
\ExplSyntaxOff
\lstset{
basicstyle=\ttfamily,
alsoletter={:},
columns=fullflexible,
identifierstyle=\namespaces
}
\begin{document}
\begin{lstlisting}
a:b c:d e:f .
\end{lstlisting}
\end{document}
Here is the error message (same with pdflatex, latex, xelatex):
restricted \write18 enabled.
entering extended mode
(./test3.tex
LaTeX2e <2021-11-15> patch level 1
L3 programming layer <2022-04-10>
(/usr/share/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texmf-dist/tex/latex/listings/listings.sty
(/usr/share/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texmf-dist/tex/latex/listings/lstmisc.sty)
(/usr/share/texmf-dist/tex/latex/listings/listings.cfg))
(/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)))
(/usr/share/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/share/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/usr/share/texmf-dist/tex/latex/graphics-def/dvips.def)) (./test3.aux))
! Incomplete \iffalse; all text was ignored after line 30.
<inserted text>
\fi
Do you have an idea to make this very useful code functional again ?

\l_demo_tlwith\tl_analysis_show:N(or if it's too verbose I recommend using my package) – user202729 Jul 15 '22 at 11:49