The regex is made for JavaScript regex engines.
It can, for example, be used in node, or pasted into search field of Visual Studio Code and used for a search/replace.
Search:
(\{%|\{\{)\s*(import|embed|include|source|extends|from)(\s*)(\(?['|"])(.*)(['|"]\)?)([\s\S]*?)(%\}|\}\})