Module:User:Theknightwho/template regex

--[==[

/(?:{{(?:	{(? (?(?={){{(?>{\g (?>}}}|\z)|\g (?>}}(?!})|\z)))(?: [^\n\-<\[{|}]++| \|(?>[^\n\-<=\[{}]++|\n(?!==)|\g |[^=}]|}(?!}))*=?| (? (?=[\n\-<[{])(?> \[\[(?>[^\n\-<[\]{]++|\g |[^\]]|](?!]))*(?>]]|\z)| |\z)|\g (?>}}|\z)))|			<(? (?>				!--\X*?(?>-->|\z)|				\/?(?>includeonly|noinclude|onlyinclude)(?>>|\/>|\s[^>]*>)|				(? (?>categorytree|ce|charinsert|chem|dynamicpagelist|gallery|graph|hiero|imagemap|indicator|inputbox|langconvert|mapframe|maplink|math|nowiki|phonos|poem|pre|ref|references|score|section|source|syntaxhighlight|talkpage|templatedata|templatestyles|thread|timeline))(?>>|\/>|\s[^>]*>)(?>(?<=\/>)|\X*?<\/\k \s*>)			))|			\n=(?>[^\n\-<[{]++|(?!\n)\g |\N)*|			-{(?>{\g |(?>[^\n\-<[{}]++|\g |[^}]|}(?!-))*(?>}-|\z))		))|		[^|}]|		}(?!})	)*(*PRUNE))}|	\g )}}|<\g (*SKIP)(*F))/gix

]==]