diff --git a/go.mod b/go.mod index 733bbe27..90076f3f 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/Azure/go-autorest/autorest/adal v0.9.24 github.com/Azure/go-autorest/tracing v0.6.1 github.com/alitto/pond/v2 v2.7.1 - github.com/dlclark/regexp2 v1.11.5 + github.com/dlclark/regexp2 v1.12.0 github.com/docker/cli v29.4.0+incompatible github.com/golang-jwt/jwt/v4 v4.5.2 github.com/google/uuid v1.6.0 diff --git a/go.sum b/go.sum index 04ccf2c1..961c6052 100644 --- a/go.sum +++ b/go.sum @@ -27,8 +27,8 @@ github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7h github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ= -github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dlclark/regexp2 v1.12.0 h1:0j4c5qQmnC6XOWNjP3PIXURXN2gWx76rd3KvgdPkCz8= +github.com/dlclark/regexp2 v1.12.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/cli v29.4.0+incompatible h1:+IjXULMetlvWJiuSI0Nbor36lcJ5BTcVpUmB21KBoVM= github.com/docker/cli v29.4.0+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/docker-credential-helpers v0.6.4 h1:axCks+yV+2MR3/kZhAmy07yC56WZ2Pwu/fKWtKuZB0o= diff --git a/vendor/github.com/dlclark/regexp2/README.md b/vendor/github.com/dlclark/regexp2/README.md index 9cbc1d8d..3d56cf3e 100644 --- a/vendor/github.com/dlclark/regexp2/README.md +++ b/vendor/github.com/dlclark/regexp2/README.md @@ -69,7 +69,7 @@ The internals of `regexp2` always operate on `[]rune` so `Index` and `Length` da | --- | --- | --- | | Catastrophic backtracking possible | no, constant execution time guarantees | yes, if your pattern is at risk you can use the `re.MatchTimeout` field | | Python-style capture groups `(?Pre)` | yes | no (yes in RE2 compat mode) | -| .NET-style capture groups `(?re)` or `(?'name're)` | no | yes | +| .NET-style capture groups `(?re)` or `(?'name're)` | yes | yes | | comments `(?#comment)` | no | yes | | branch numbering reset `(?\|a\|b)` | no | no | | possessive match `(?>re)` | no | yes | diff --git a/vendor/github.com/dlclark/regexp2/runner.go b/vendor/github.com/dlclark/regexp2/runner.go index 56759f14..4bb0dfa1 100644 --- a/vendor/github.com/dlclark/regexp2/runner.go +++ b/vendor/github.com/dlclark/regexp2/runner.go @@ -313,12 +313,9 @@ func (r *runner) execute() error { } } else { // The inner expression found an empty match, so we'll go directly to 'back2' if we - // backtrack. In this case, we need to push something on the stack, since back2 pops. - // However, in the case of ()+? or similar, this empty match may be legitimate, so push the text - // position associated with that empty match. - r.stackPush(oldMarkPos) - - r.trackPushNeg1(r.stackPeek()) // Save old mark + // backtrack. Don't touch the grouping stack here; instead, record the old mark and + // a flag indicating that backtracking doesn't need to pop a grouping stack frame. + r.trackPushNeg2(oldMarkPos, 0) } r.advance(1) continue @@ -334,18 +331,22 @@ func (r *runner) execute() error { r.trackPopN(2) pos := r.trackPeekN(1) - r.trackPushNeg1(r.trackPeek()) // Save old mark - r.stackPush(pos) // Make new mark - r.textto(pos) // Recall position - r.goTo(r.operand(0)) // Loop + r.trackPushNeg2(r.trackPeek(), 1) // Save old mark, note that we pushed a new mark + r.stackPush(pos) // Make new mark + r.textto(pos) // Recall position + r.goTo(r.operand(0)) // Loop continue case syntax.Lazybranchmark | syntax.Back2: // The lazy loop has failed. We'll do a true backtrack and // start over before the lazy loop. - r.stackPop() - r.trackPop() - r.stackPush(r.trackPeek()) // Recall old mark + r.trackPopN(2) + oldMark := r.trackPeek() + needsPop := r.trackPeekN(1) + if needsPop != 0 { + r.stackPop() + } + r.stackPush(oldMark) // Recall old mark break case syntax.Setcount: diff --git a/vendor/modules.txt b/vendor/modules.txt index 246c51d5..d027c199 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -29,7 +29,7 @@ github.com/alitto/pond/v2/internal/linkedbuffer # github.com/davecgh/go-spew v1.1.1 ## explicit github.com/davecgh/go-spew/spew -# github.com/dlclark/regexp2 v1.11.5 +# github.com/dlclark/regexp2 v1.12.0 ## explicit; go 1.13 github.com/dlclark/regexp2 github.com/dlclark/regexp2/syntax