|
reHeaderPatternV2 = regexp.MustCompile(`<!--\s*([^:]+):\s*(.*)\s*-->`) |
The pattern (.*)\s*-->
will always put all whitespace in the capturing group as *
is greedy. To exclude them use (.*?)˜s*-->
to make the *
non-greedy. Alternatively leave the \s*
out.