> : All LaTeX3 functions are either fully expandable or engine-protected. In > : this case, we are talking about protected functions: these are not > : expandable. (In the documentation, expandable functions are marked with > : a star.) Joseph is right. Regular expression matching is already tough enough to not try to do it expandably (besides, that would become unreasonably slow, and would break in corner cases). What you seem to be trying can be done as follows instead: \regex_match:nnTF {o} {o} { \xdef\foo{0,0} } { \xdef\foo{1,1} } -- Regards, Bruno