An expression with the following regular is used:
Purpose: Remove the contents of the {} in the string
The last regular expression used is {(. *?)}
Look first . *? :
First of all. is used to match strings, but only once.
So add *, can let. is matched several times, but this will match until the last one is found,
Keep adding? , which indicates a non-greedy match, is to stop when. * matches to}. Then continue to match the next.
Look Again (. *?),
() means the grouping operation, the default is capture, that is, the grouped content can be taken out separately, by default each group has an index, starting from 1, according to the "(" Order of the index value.
In fact, after matching to the first {result}, the result is taken out.
Last look {(. *?)}:
A {} is used at the outermost perimeter, meaning that the data in {} is to be taken.
Regular and profound, and allow me to continue to study it!
An essay record of regular expressions under Python