```Java
return CharMatcher.anyOf(".-")
        .or(CharMatcher.inRange('A', 'Z'))
        .or(CharMatcher.inRange('a', 'z'))
        .or(CharMatcher.inRange('0', '9'))
        .negate()
        .trimAndCollapseFrom(s, '-');