Regex in XLS calculation

Hi all,

How to use Regex in the calculation column of XLSForm to get the value needed instead the boolean returned by the function regex(.,’…’)? So far I ve only seen regex in specifying constraints.

Thank you!

As far as we know, it’s specified as returning a boolean:

Also pay attention: There is an essential difference in regex behaviour between Collect and Enketo. See previous discussion in community. See also support article (at the bottom):


@wroos Thanks for the quick answer. Is there any other function that can be used to return the value? or is it just not possible to get it?

Maybe substr( ) or substring-before( ) or substring-after( ) or even translate( ) might partly help. See

If it’s numeric type: mod to extract trailing digits and / (division) with round( ) or int( ) to extract leading digits might be useful.

If you tell the community in more detail, please, what you want to do, support may be easier…

1 Like