Last change
on this file since 2b65789 was 9dd526f, checked in by andrejTavchioski <andrej.tavchioski@…>, 3 years ago |
backend refactoring
|
-
Property mode
set to
100644
|
File size:
426 bytes
|
Rev | Line | |
---|
[ce6ad22] | 1 | package parkup.configs.email;
|
---|
| 2 |
|
---|
[9dd526f] | 3 |
|
---|
[ce6ad22] | 4 | import org.springframework.stereotype.Service;
|
---|
| 5 |
|
---|
| 6 | import java.util.function.Predicate;
|
---|
[9dd526f] | 7 | import java.util.regex.Pattern;
|
---|
[ce6ad22] | 8 |
|
---|
| 9 | @Service
|
---|
| 10 | public 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.