Changed behavior of regexp.Compile in go1.22

It looks like the behavior of has changed in go1.22 compared to go1.21.

This creates an error Go Playground - The Go Programming Language (1.21) while this does not anymore Go Playground - The Go Programming Language (1.22).

Is this intended?

Support for the (?<name>) syntax for capturing groups was added in 1.22. See this issue comment, regexp: Documentation doesn't mention that (?<name>...) capturing group syntax isn't currently supported · Issue #64108 · golang/go · GitHub.

However for some reason it does not appear to be mentioned in the 1.22 release notes. Go 1.22 Release Notes - The Go Programming Language

1 Like

Thanks for the ref. That’s what I was looking for.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.