0

How does ^(x*)(.+)- \2= \1$ match xxx - xx = x. I am not understanding how the captured group2 is "xx" and how captured group 1 is "x". Shouldn't group1 be "xxx" since (x*) is asking for "x" 0 or more times which means it should cover all the x's up until the first space, right? I also am not understanding where group2 is getting its x's from since that group starts after (x*) and before "-" which means it should start at the first space after "xxx" and end right before "-"? I need help understanding this. Can someone break it down for me please.

0 Answers0