^[ A-Za-z0-9_@./'*#&+-]*$
import java.util.regex.Matcher;
import java.util.regex.Pattern;
class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
String email="pawan*k@ed-ynamic.com";
String regex = "^[ A-Za-z0-9_@./'*#&+-]*$";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(email);
System.out.println("--opp---"+ matcher.matches());
//return matcher.matches();
}
}
"^[_A-Za-z0-9-\\+_@./'*#&+-]+(\\.[_A-Za-z0-9-_@./'*#&+-]+)*@" + "[A-Za-z0-9-_@./'*#&+-]+(\\.[A-Za-z0-9_@./'*#&+-]+)*(\\.[A-Za-z_@./'*#&+-]{2,})$"
; https://stackoverflow.com/questions/17439917/regex-to-accept-alphanumeric-and-some-special-character-in-javascript
https://www.computerhope.com/unix/regex-quickref.htm
start and end with alpha numeric
; https://stackoverflow.com/questions/17439917/regex-to-accept-alphanumeric-and-some-special-character-in-javascript
class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
String email="a-alsaqal@mada.jo.com.in";
String regex ="^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+[a-zA-Z0-9]$";
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(email);
System.out.println("--opp---"+ matcher.matches());
//return matcher.matches();
}
}
No comments:
Post a Comment