mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Group regex within anchoring
This ensures that anchoring will apply to the entire anchored expression, eg. a pattern like `foo|bar` will only match the strings "foo" and "bar" (`^(?:foo|bar)$`), instead of matching any string that begins with "foo" or ends with "bar" (`^foo|bar$`).
This commit is contained in:
committed by
GitHub
parent
1971816663
commit
3c8e6d7151
@@ -514,7 +514,7 @@ func anchorRegex(pattern string) string {
|
||||
if pattern == "" {
|
||||
return pattern
|
||||
}
|
||||
return "^" + pattern + "$"
|
||||
return "^(?:" + pattern + ")$"
|
||||
}
|
||||
|
||||
// Select returns a list of resources that
|
||||
|
||||
Reference in New Issue
Block a user