Answer the following question about the execution of the bel…
Answer the following question about the execution of the below code. Assume that both Pattern and Matcher classes are correctly imported from java.util.regex. String input = “blueberry, raspberry, golden berry, ” + “black mulberry, acai berry, blackcurrant”;Pattern[] patterns = new Pattern[3];patterns[0] = Pattern.compile(“\\w+\\s\\w+”);patterns[1] = Pattern.compile(“\\w+berry”);patterns[2] = Pattern.compile(“\\w+\\sberry”);for (Pattern p : patterns) { Matcher m = p.matcher(input); while(m.find()) { System.out.println(m.group()); }} Reminder: to concisely answer the questions. If the question has a numerical answer, please type the number. A. How many lines are printed for patterns[0]? B. How many lines are printed for patterns[1]? C. How m any lines are printed for patterns[3]? D. Which of the words listed in the input string won’t be printed for any of the patterns? Regular expression reference: \w any alphanumeric character [a-zA-Z0-9_] \s any whitespace + one or more repetitions
Read Details