Java recursive(?) repeated(?) deep(?) pattern matching
问题 I'm trying to get ALL the substrings in the input string that match the given pattern. For example, Given string: aaxxbbaxb Pattern: a[a-z]{0,3}b (What I actually want to express is: all the patterns that starts with a and ends with b, but can have up to 2 alphabets in between them) Exact results that I want (with their indexes): aaxxb: index 0~4 axxb: index 1~4 axxbb: index 1~5 axb: index 6~8 But when I run it through the Pattern and Matcher classes using Pattern.compile() and Matcher.find()