Java function works in Eclipse but not in Pega 7.1.7
Hi there,
I created a Java method in Pega which finds and replaces the date for "Current Date" within a text (String). Everything is working fine as long as I am using as an input for the function a simple text.
During runtime when the method gets called it should replace the date for "Current Date" within a HTML code. In this situation the date gets not replaced in Pega (the function works then still fine in Eclipse).
My java function:
String regexPattern = "Current Date: [0-9]?{6}";
java.util.regex.Pattern myPattern = java.util.regex.Pattern.compile(regexPattern);
java.util.regex.Matcher myMatch = myPattern.matcher(originText);
return myMatch.replaceAll("Current Date: " + replacementText);
I guess that there could be a problem with one of the characters of the HTML code in Pega.
Has anyone a suggestion how to solve this issue?
Many thanks in advance and regards,
Manuela