问题标签 [balanced-groups]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
regex - How to match my whole string with regular expression while allowing nested patterns
My current regular expression only matches the nested pattern not the outermost @if....endif@ pattern. How can I modify my expression to match the outermost pattern. If the outermost pattern is removed from the string the expression should then match all before nested patterns. Many or the or-patterns are only relevant in the real world.
Regex:
String:
I want the expression to match the whole string from @if to endif@