I am a newbie to expl3 programming and stumbled over a problem with colon (:
) parsing.
For some TikZ related code I have to split #1:#2
into pieces. I found several questions and in this direction, but I could not manage to find a proper solution.
I was able to reproduce the lower case trick, but this includes the deprecated \tex_lowercase:D
. Here is my current working, but deprecated code:
\documentclass{article}
\usepackage{expl3,xparse}
\ExplSyntaxOn
\cs_set_nopar:Npn \__example_point:nn #1#2
{
Example~with~#1~and~#2.
}
\group_begin:
\char_set_lccode:nn { `? } { `: }
\tex_lowercase:D {
\group_end:
\cs_set_nopar:Npn \__example_point:w #1 ? #2 \q_stop
}{
\__example_point:nn {#1}{#2}
}
\cs_set_nopar:Npn \__example_point:n #1
{
\__example_point:w #1 \q_stop
}
\DeclareDocumentCommand{\myexample}{ m }{ \__example_point:n {#1} }
\ExplSyntaxOff
\begin{document}
\myexample{34.2:47.9}
\end{document}
The output is
Example with 34.2 and 47.9.
I am searching for a replacement for \tex_lowercase:D
and my current \__example_point:w
.
I guess there is some clever way using expansions, but I was not able to find it.