Question
iriz
FR
Last activity: 29 Feb 2024 4:04 EST
regex multiple email adress
How to test 3 adress with comma seperator in regex code at the end ";" ,
Bellow the example of code java
public static void main(String[] args) {
String emailList = "[email protected]; [email protected]; [email protected];";
String regex = "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}(\\s*;\\s*[a-zA-Z0- 9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}){2}$";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(emailList);
if (matcher.matches()) {
System.out.println("Valid email addresses format.");
} else {
System.out.println("Invalid email addresses format.");
}
}
I try this in pega with @pxContainsViaRegex function ega ==>
@pxContainsViaRegex(Param.Email,"\\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(\\s*;\\s*[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}){2}$",false)
this code always return false ,
any help please