expl3 replace \tex_lowercase:D for colon parsing
You can exploit \use:x
\documentclass{article}
\usepackage{expl3,xparse}
\ExplSyntaxOn
\cs_new_nopar:Npn \__example_point:nn #1#2
{
Example~with~#1~and~#2.
}
\use:x
{
\cs_new_nopar:Npn \exp_not:N \__example_point:w ##1 \c_colon_str ##2 \exp_not:N \q_stop
}
{
\__example_point:nn {#1}{#2}
}
\cs_new_nopar:Npn \__example_point:n #1
{
\__example_point:w #1 \q_stop
}
\NewDocumentCommand{\myexample}{ m }{ \__example_point:n {#1} }
\ExplSyntaxOff
\begin{document}
\myexample{34.2:47.9}
\end{document}
Note \cs_new…
, which is better practice than \cs_set…
.
This also works:
\ExplSyntaxOn
\cs_new_nopar:Npn \__example_point:nn #1#2
{
Example~with~#1~and~#2.
}
\tl_set:Nx \l_tmpa_tl { ##1 \c_colon_str ##2 }
\exp_last_unbraced:NNV \cs_new_nopar:Npn \__example_point:w \l_tmpa_tl \q_stop
{
\__example_point:nn {#1}{#2}
}
\cs_new_nopar:Npn \__example_point:n #1
{
\__example_point:w #1 \q_stop
}
\NewDocumentCommand{\myexample}{ m }{ \__example_point:n {#1} }
\ExplSyntaxOff
You could use \seq_set_split:Nnn
like this:
\documentclass{article}
\usepackage{expl3,xparse}
\ExplSyntaxOn
\cs_set_nopar:Npn \__example_point:nn #1#2
{
Example~with~#1~and~#2.
}
\cs_generate_variant:Nn \seq_set_split:Nnn {NVn}
\cs_set_nopar:Npn \__example_point:n #1
{
\seq_set_split:NVn \l_tmpa_seq \c_colon_str {#1}
\__example_point:nn {\seq_item:Nn\l_tmpa_seq {1}}{\seq_item:Nn\l_tmpa_seq {2}}
}
\DeclareDocumentCommand{\myexample}{ m }{ \__example_point:n {#1} }
\ExplSyntaxOff
\begin{document}
\myexample{34.2:47.9}
\end{document}