Last change
on this file was dfd5d87, checked in by Marko <Marko@…>, 2 years ago |
Registration logic with confirmation token implemented
|
-
Property mode
set to
100644
|
File size:
436 bytes
|
Line | |
---|
1 | package finki.it.phoneluxbackend.security.email;
|
---|
2 |
|
---|
3 | import org.springframework.stereotype.Service;
|
---|
4 |
|
---|
5 | import java.util.function.Predicate;
|
---|
6 | import java.util.regex.Pattern;
|
---|
7 |
|
---|
8 | @Service
|
---|
9 | public class EmailValidator implements Predicate<String> {
|
---|
10 |
|
---|
11 | @Override
|
---|
12 | public boolean test(String s) {
|
---|
13 | // regex to validate email
|
---|
14 | return Pattern.compile("^[a-zA-Z0-9_!#$%&'*+/=?`{|}~^.-]+@[a-zA-Z0-9.-]+$").matcher(s).matches();
|
---|
15 | }
|
---|
16 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.