AnsweredAssumed Answered

Unexpected behaviour of replace() function

Question asked by freidavi on Jan 9, 2018
Latest reply on Jan 11, 2018 by freidavi

Dear all,


I'm using Nintex Forms 2013 and the replace() function gives me some troubles.

I get a string like this, from an people picker field:



Where the length of the "XXXXXX" and "YYYYYY" substrings (at least to my knowledge) are not known. I want to extract the substring "StringOfInterest", i.e. replacing "XXXXXX|YYYYYY|" with "". I am using the expression  (.*\|){2} , which does exactly what i want to, when i enter it on , but if i use it in the replace function in a calculated field like so:




i always get an empty string (yes, PeoplePicker has a value in it). 

If i use something like this:




i get the output:




,which implies that the expression matches, but disregards the umatched part of the source String. This sounds to me like a thing that the replace function shouldn't do, or did i misunderstand the replace function?
It would be nice if someone could shine a light on my lack of knowledge.