source: sources/app/src/main/java/parkup/configs/email/EmailValidator.java@ 9dd526f

Last change on this file since 9dd526f was 9dd526f, checked in by andrejTavchioski <andrej.tavchioski@…>, 2 years ago

backend refactoring

  • Property mode set to 100644
File size: 426 bytes
RevLine 
[ce6ad22]1package parkup.configs.email;
2
[9dd526f]3
[ce6ad22]4import org.springframework.stereotype.Service;
5
6import java.util.function.Predicate;
[9dd526f]7import java.util.regex.Pattern;
[ce6ad22]8
9@Service
10public class EmailValidator implements Predicate<String> {
11 @Override
12 public boolean test(String s) {
[9dd526f]13 String regexPattern = "^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$";
14 return Pattern.compile(regexPattern).matcher(s).matches();
[ce6ad22]15 }
16}
Note: See TracBrowser for help on using the repository browser.