private @NonNull ArgumentParseResult<String> parseQuoted(
            final @NonNull CommandContext<C> commandContext,
            final @NonNull CommandInput commandInput
    ) {
        final char peek = commandInput.peek();
        if (peek != '\'' && peek != '"') {
            return ArgumentParseResult.success(commandInput.readString());
        }

        final String string = commandInput.remainingInput();

        final Matcher doubleMatcher = QUOTED_DOUBLE.matcher(string);
        String doubleMatch = null;
        if (doubleMatcher.find()) {
            doubleMatch = doubleMatcher.group("inner");
        }
        final Matcher singleMatcher = QUOTED_SINGLE.matcher(string);
        String singleMatch = null;
        if (singleMatcher.find()) {
            singleMatch = singleMatcher.group("inner");
        }

        String inner = null;
        if (singleMatch != null && doubleMatch != null) {
            final int singleIndex = string.indexOf(singleMatch);
            final int doubleIndex = string.indexOf(doubleMatch);
            inner = doubleIndex < singleIndex ? doubleMatch : singleMatch;
        } else if (singleMatch == null && doubleMatch != null) {
            inner = doubleMatch;
        } else if (singleMatch != null) {
            inner = singleMatch;
        }

        if (inner != null) {
            final int numSpaces = StringUtils.countCharOccurrences(inner, ' ');
            for (int i = 0; i <= numSpaces; i++) {
                commandInput.readString();
            }
        } else {
            inner = commandInput.peekString();
            if (inner.startsWith("\"") || inner.startsWith("'")) {
                return ArgumentParseResult.failure(new StringParseException(
                        commandInput.remainingInput(),
                        StringMode.QUOTED, commandContext
                ));
            } else {
                commandInput.readString();
            }
        }

        inner = inner.replace("\\\"", "\"").replace("\\'", "'");

        return ArgumentParseResult.success(inner);
    }
Construct a new string parser

@param stringMode         String parsing mode
cloud-core/src/main/java/org/incendo/cloud/parser/standard/StringParser.java