java regex pattern validate username
Regular expression username pattern ^[a-z0-9_-]{5,15}$^[a-z0-9_-]{5,15}$ This regular expression refers to a pattern which accepts 5 to 15 characters with any lower case character, digit or special symbol “_-” only. Example package com.w3schools; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; public class RegexTest { private static final String PATTERN = "^[a-z0-9_-]{5,15}$"; public static … Read more