(.*?) regular expression

1. . matches any character except the newline character "\n";
2. * means match the previous character 0 times or unlimited times;
3. ? means 0 or 1 repetition of the previous character
4, + or * followed by ? Indicates non-greedy matching, that is, as few matches as possible, such as *? Repeat any number of times, but repeat as little as possible;
5. .*? means match any number of repetitions, but use the fewest repetitions on the premise that the entire match can be successful.
For example: a.*?b matches the shortest string that starts with a and ends with b. If it is applied to aabab, it will match aab and ab.

Guess you like

Origin blog.csdn.net/weixin_42748604/article/details/109117875