Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
String username = "Xx_thelegend27_xX";
final Pattern pattern = Pattern.compile("(xx|(_|))(?<username>\\w*)(_|(xx))", Pattern.CASE_INSENSITIVE);
final Matcher matcher = pattern.matcher(username);
if(matcher.matches()){
this.showError(String.format("Your username cannot be that... Try: %s", matcher.group("username")));
}else {
registerOrSomething();
}
joke/meme