Regex.replace not working

Hi

I have the following code inside an Assign activity. Regex.Replace(Mail_Body_LSTR,“kind[[:print:]]+","").
Were Mail_Body_LSTR is a string. In the regex editor it works by highlighting all the words after kind, however in the assign it does not remove the words. The word kind is always in lower case so not a case sensitive match not found.

Regards

Massimo

1 Like

Fine
may i know what is the string in Mail_Body_LSTR

Cheers @Massimo

it should be
System.Text.RegularExpression.RegEx.Replace(Mail_Body_LSTR,“kind[[:print:]]+","")

Hi @Palaniyappan

The string is as follows.

hi how are you doing today.what is my average score. kind regards massimo gatta | business analyst publicis commercecambridge retail park, 22 witkoppen road, paulshofpostnet suite #249, private bag x87, bryanston, 2024phone: +27 (0)87 255 1257 www.creativecounsel.co.za http://www.creativecounsel.co.za/ www.publicisgroupe.com http://www.publicisgroupe.com/

1 Like

Hi @ashley11

The namespace is imported so even with or with out its not working.

1 Like

Kindly try with this in assign activity

system.Text.RegularExpressions.Regex.Replace(str_input,"(kind).*","")

it works
image
Cheers @Massimo

hi @Palaniyappan

Thank you that seems to work. Much appreciated

1 Like

Great
Cheers @Massimo

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.