I\'m trying the username chains in Java with following rules:
What about:
username.matches("[a-zA-Z0-9.\\-_]{3,}")