/guava/guava/src/com/google/common/net/InternetDomainName.java
} return false;if ( part.length( ) < 1 || part.length( ) > MAX_DOMAIN_PART_LENGTH) {
if ( part.length ( ) < 1 || part.length ( ) > MAX_DOMAIN_PART_LENGTH ) { return false; }
private static final CharMatcher DIGIT_MATCHER = CharMatcher.inRange('0', '9'); private static final CharMatcher LETTER_MATCHER = CharMatcher.inRange('a', 'z').or(CharMatcher.inRange('A', 'Z')); private static final CharMatcher PART_CHAR_MATCHER = DIGIT_MATCHER.or(LETTER_MATCHER).or(DASH_MATCHER); private static boolean validatePart(String part, boolean isFinalPart) { <extra_id_0> String asciiChars = CharMatcher.ascii().retainFrom(part); if (!PART_CHAR_MATCHER.matchesAllOf(asciiChars)) { return false; } if (DASH_MATCHER.matches(part.charAt(0)) || DASH_MATCHER.matches(part.charAt(part.length() - 1))) {