The following regexp code gives the result
\documentclass[11pt]{book} % use larger type; default would be 10pt
\usepackage{pgffor}
\usepackage{l3regex,xparse}
\usepackage{etextools}
\begin{document}
\ExplSyntaxOn
\seq_new:N \l_uiy_result_seq
\NewDocumentCommand {\UiySplit } { m }
{
%\regex_extract_all:nnN { \D+ | \d+(?:\.\d*)? } {#1} \l_uiy_result_seq
\regex_extract_all:nnN {(f)(\d+(?:\.\d*)?)(s)(\d+(?:\.\d*)?)} {#1} \l_uiy_result_seq
\seq_map_inline:Nn \l_uiy_result_seq { item:~##1\par }
}
\ExplSyntaxOff
\UiySplit{f234s222}
\end{document}
gives the following output
item: f234s222
item: f
item: 234
item: s
item: 222
Why is it capturing the whole string and outputting it?
Similarly:
\regex_extract_all:nnN {(f|s)(\d+(?:\.\d*)?){1,2}} {#1} \l_uiy_result_seq
is outputing
item: f234
item: f
item: 234
item: s222
item: s
item: 222
the first and fourth shouldn't be there? (well, I don't want them captured)
\command{<submatch 1>}{<submatch 2>}: then nothing forces you to keep the<submatch 0>(full match, which you are trying to get rid of). – Bruno Le Floch Mar 17 '12 at 22:35\G.*?\Kto the start of the regular expression.\Ganchors the match at the end of the previous match,.*?matches as few characters as possible, and\Kresets the beginning of the match. Hence,\G.*?\Kmatches everything from the end of the previous match to the next "real" match, and thanks to\Kit pretends that the starting point is the expected one (so that\0is still correct). – Bruno Le Floch Mar 17 '12 at 22:36