Regex to exclude specific characters
Your pattern first matches from { till } and then matches in a non greedy way .*?
giving up matches until it can match a p
, dot space and 1+ digits.
It can do that because the dot can also match {}
.
You could use negated character classes [^{}]
to not match {}
\{[^{}]*\}[^{}]+p\. [0-9]+
Regex demo