public static void search_query(String[] query, String[] pages) {

        StringBuilder re = new StringBuilder();
        for (String q : query) {
            re.append(q).append(".*");
        }

        Pattern pattern = Pattern.compile(re.toString());

        int matchedCount = 0;
        for (String page : pages) {
            Matcher matcher = pattern.matcher(page);
            if(matcher.matches()) matchedCount++;

        }

        System.out.println(matchedCount);

    }