public static void main(String[] args) {
        String[] patterns; 
        if(args.length < 2) {
            patterns = PATTERNS;
        } else {
            patterns = args;
        }

        String argString = patterns[0];
        System.out.println("Input: " + argString);
        for(int i = 1; i < patterns.length; ++i) {
            System.out.println("RegExp: " + patterns[i]);
            Pattern pattern = Pattern.compile(patterns[i]);
            Matcher matcher = pattern.matcher(argString);
            while(matcher.find()) {
                System.out.println("Match \"" + matcher.group() +
                        "\" at positions " + matcher.start() +
                        (matcher.end() - matcher.start() < 2 ? "" :
                        "-" + (matcher.end() - 1)));
            }
        }
    }