code: public static boolean doesStringContainOpenQuote(String text) {
          boolean doubleQuote = false;
          boolean singleQuote = false;
          boolean escapedByBackSlash = false;
          // do not parse comment
          if (commentPattern.matcher(text).find())
              return false;
  
          for (int i = 0; i < text.length(); i++) {
               if (text.charAt(i) == BACK_SLASH || escapedByBackSlash) {
                   escapedByBackSlash = !escapedByBackSlash;
                   continue;
               }
              if (text.charAt(i) == SINGLE_QUOTE) {
                  if (!doubleQuote)
                      singleQuote = !singleQuote;
              }
              else if (text.charAt(i) == DOUBLE_QUOTE) {
                  if (!singleQuote)
                      doubleQuote = !doubleQuote;
              }
          }
          return doubleQuote || singleQuote;
      }
docs: Check if a string contain openBlocking quotes. Escaped quotes does not count.
  
  @param text text
  @return true if it contains openBlocking quotes, else false