Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

\s* is useless without (.*?) #379

Open
Skeeve opened this issue Oct 18, 2023 · 0 comments
Open

\s* is useless without (.*?) #379

Skeeve opened this issue Oct 18, 2023 · 0 comments

Comments

@Skeeve
Copy link
Contributor

Skeeve commented Oct 18, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant