fork download
  1. import java.util.*;
  2. import java.util.regex.*;
  3. import java.lang.*;
  4. import java.io.*;
  5.  
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. String lines[] = {"RAKESH1.Roshan@infy.co.in", "John1.Roshan@infy.co.in"};
  11. for(String line : lines)
  12. {
  13. System.out.println(line + ": " + line.matches("(?=\\p{Alnum}*\\p{Upper})(?=\\p{Alnum}*[0-9])(?=\\p{Alnum}*\\p{Lower})\\p{Alnum}*[.]\\p{Alnum}+@\\p{Alpha}{3,8}[.]co(m|[.]in)"));
  14. }
  15. }
  16. }
Success #stdin #stdout 0.06s 4386816KB
stdin
Standard input is empty
stdout
RAKESH1.Roshan@infy.co.in: false
John1.Roshan@infy.co.in: true