kovetskiy/mark

\s* is useless without (.*?)

Opened this issue · 0 comments

Skeeve commented

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.