Hi there,

I have Text as name "John Delushi". I want to replace this name with format Joh* ****shi

I'm trying use Regex_replace() for firstable i try this pattern [a-z] and it works. All of character except space replaced by asterisk. Then i tried this pattern :

 "[a-z]{3, "+ Length(Getdata.List.Current.MyData.Name)/-3 +"}"

my expectation is replace any character in which contain a-z between 3 to maxlength-3

but it didn't work. Can you tell me how to use correct regex ? or is there any recommendations i must learn which compatible format with outsystems 11 ?

Thanks

Hi,

Instead of using regex for everything try something like this 

SyntaxEditor Code Snippet

Substr(Var1,0,3) + Regex_Replace(Substr(Var1,3,Length(Var1)-6),".","*") + Substr(Var1,Length(Var1)-3,3)

where Var1 is the name. Keep in mind this will not work for names with less than 6 characters. You should add and if to only do this for names with more than that.

Regards,

Marcelo