code: private static boolean resemblesPropertyPattern(String pattern, int pos) {
          // Patterns are at least 5 characters long
          if ((pos+5) > pattern.length()) {
              return false;
          }
  
          // Look for an opening [:, [:^, \p, or \P
          return pattern.regionMatches(pos, "[:", 0, 2) ||
                  pattern.regionMatches(true, pos, "\\p", 0, 2) ||
                  pattern.regionMatches(pos, "\\N", 0, 2);
      }
docs: Return true if the given position, in the given pattern, appears
  to be the start of a property set pattern.