I am working on a chat application so the thing is one should not be able to send an empty message so for that I did following things
For empty spaces
private boolean emptySpacecheck(String msg){
return msg.matches(".*\\w.*");
}
For Special Characters
private boolean specCharcheck(String msg){
return msg.matches("[$&+,:;=\\\\\\\\?@#|/'<>.^*()%!-]");
}
Above code works fine if someone tries to send an empty message or message that contains only spaces it shows an error the problem it's showing error when trying to send only emoji as msg. How to check for emoji using regex?