You can use \[.*?\]\{.*?\}
on your example which I tested out here.
This breaks into two smaller regex:
\[.*?\]
, which is the square brackets with any chars inside.\{.*?\}
, which is the curly brackets with any chars inside.
Both of these are using a non-greedy .*
inside the brackets. This way if there is more then one match per line, it will not grab both as one match.
6
solved Regex for the following expression [closed]