Q. What will be the result when non greedy repetition is used on the pattern /a+?b/ ?
β
Correct Answer: (A)
Matches the letter b preceded by the fewest number of a’s possible
Explanation: Using non greedy repetition may not always produce the results you expect. /a+?b/ matches the letter b preceded by the fewest number of a’s possible.