I am using the following regex in vscode for a search and replace. It is to match an outer tag with plus 3 nested tags.
<tag>(((.|\n)*?)(</tag>)){4}
If i add any character to the end of this regex, vscode crashes. In my case i was going to specify a tag after that match.
Im pretty new to regex so trying to keep it simple.
I know this is a common problem and something to do with backtracking and i want to know how to simply this.