How to replace a String with any pattern matches replaced

how can we replace any string please suggest me any alternative function of replace ,replace function is not working through which we can get below eg output

  • Examples
    • replace(“aaabbbaa”, “a+”, “a”) returns “aba”
    • replace(“abbbccd”, “a.*c”, “”) returns “cd”

Welcome to the community, @nid010! Could you also explain the use-case of this function? Have you used this before with KoBoToolbox or other data collection software previously? Could you show us some documents so that we could dig into it?

1 Like

Hi @Kal_Lam ,

I also need the same.
In CommCare we can use replace function.
https://help.commcarehq.org/display/commcarepublic/CommCare+Functions#CommCareFunctions-replace
Can we use this function in Kobo?

Thanks & Regards
Zeeshan Ahmad