JaimeH04 Member since 2018 2 posts
international sos
Posted: 11 months ago
Last activity: 10 months 3 weeks ago

UTF characters problem over a validation rule

Hi guys!

I'm having a little bit problem. I'm making a Validation Rule to test an email address (because the PEGA validation only see if you've an "@", so it's not a valid one) using the "ñ" character (an special character from Spain. UTF-8) over the regular expresion. Nothings matter and the email is not validate it.

Ok... so I decided to replace all the "ñ" characters over the string (theValue) and then validate it without these characters... again, nothing matters.

Could you help me to improve something to do this? I'm over Pega 8.2.1 Cloud and i suppose that my cloud machine don't have the UTF8 encoding....

A testing email address (property value - text):

The java code:

if (theValue== null || theValue.trim().equals("")) return false;
String mail = theValue.toString();

if (mail.indexOf("ñ") >0 ) { //"escaping" "ñ" character...
  mail = mail.replace("ñ", "n");

//first pattern. Working fine over other plattform, don't at PEGA

//second pattern
String regex = "^(?!\\.)(([^\\r\\\\]|\\\\[\\r\\\\])*|([-a-z0-9!#$%&'*+/=?^_`\\{|\\}~]|(?<!\\.)\\.)*)(?<!\\.)@[a-z0-9][\\w\\.-]*[a-z0-9]\\.[a-z][a-z\\.]*[a-z]$";
if (mail.matches(regex) ){
  return true;

  return false;

Thanks in advance!

***Edited by Moderator: Lochan to update platform capability tags***

Data Integration Java and Activities Case Management
Share this page LinkedIn