use regexputil

This commit is contained in:
Stanislav Seletskiy
2019-08-08 23:41:26 +03:00
parent 559b913900
commit 6b83d140d5
5 changed files with 46 additions and 26 deletions

View File

@@ -17,7 +17,12 @@ import (
var (
reIncludeDirective = regexp.MustCompile(
`(?s)<!--\s*Include:\s*(\S+)(.*?)-->`,
// <!-- Include: <template path>
// <optional yaml data> -->
`(?s)` + // dot capture newlines
/**/ `<!--\s*Include:\s*(?P<template>\S+)\s*` +
/* */ `(\n(?P<config>.*?))?-->`,
)
)