You need to sign in to do that
Don't have an account?

ReplaceAll Help - Replace String with a Mask
Hi all,
I am trying to mask certain details in the body of an email message using regex and the string method replaceall. I've no issue with the regex, I can see it matching and can add a value to the body with a match. However I have not been able to replace the matched substring, this is what I am trying at the moment:
What I am missing?
I am trying to mask certain details in the body of an email message using regex and the string method replaceall. I've no issue with the regex, I can see it matching and can add a value to the body with a match. However I have not been able to replace the matched substring, this is what I am trying at the moment:
String mask = '*'; String embody = 'Test text body 1111 test'; Pattern p = Pattern.Compile('(\\d{4})'); //simplified p.matcher(em.TextBody).replaceAll(Mask);As I mentioned I am confident that the regex is matching by using debug comments and I have updated the field on a match but I cannot get replaceall to work :(
What I am missing?
http://salesforcesource.blogspot.in/2010/01/utilizing-apex-pattern-and-matcher.html