Trying to match only strings 10-30 characters long with only a-z and 0-9 (but not only numbers) in the string. Seems to work Except when the string starts with a number then it fails. Not sure about the \D which should fix the not only numbers
static final Pattern UNIQUE_ID_PATTERN = Pattern.compile("^\\D[A-Za-z0-9_-]{10,30}$");
UNIQUE_ID_PATTERN.matcher("1eeeeeeeee333e").matches(); // Does not work
UNIQUE_ID_PATTERN.matcher("eeeeeeeee333e").matches(); // Works