0
Why (.+)can match a string
I thought a (.+)can only math one or more repeats of a single character but the results is it can match any strings. Isn't . means any character ? And I what is the "1" in (.+)\1 mean? Does it means one or more times repeat of the parrten ??
2 Answers
0
. Means any char,+means at least one,so (.+) means one or more charactors,no matter these chars are the same or not. ()means group,\1 means obtaining the first group from the answer groups.
0
I finnally understand that \1 is more like \(partten\)\n in java.