We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
go version go1.21.5 darwin/arm64
go env
N/A
From regexp/syntax:
(?:re) non-capturing group
https://go.dev/play/p/YKM2yyDC2Bm
import "regexp/syntax" fmt.Println(syntax.Parse("(?:A)", 0))
Output:
<nil> error parsing regexp: missing argument to repetition operator: `?`
$ perl -E 'say ("A" =~ /(?:A)/)' 1 $ go run github.com/dolmen-go/goeval@latest -i=regexp/syntax -i=fmt 'fmt.Println(syntax.Parse("(A)", 0))' (A) <nil> $ go run github.com/dolmen-go/goeval@latest -i=regexp/syntax -i=fmt 'fmt.Println(syntax.Parse("(?:A)", 0))' <nil> error parsing regexp: missing argument to repetition operator: `?`
no error
The text was updated successfully, but these errors were encountered:
Doing this works:
import "regexp/syntax" fmt.Println(syntax.Parse("(?:A)", syntax.Perl))
(this is what regexp.Compile uses)
regexp.Compile
0 is posix syntax:
0
go/src/regexp/syntax/parse.go
Line 72 in b18b058
Which does not have support for non capturing groups as far as I checked.
There is this text which attempts to explain this. https://pkg.go.dev/regexp/syntax#hdr-Syntax
I guess each feature could explain under which syntax it is supposed to work. In a table form it might even be digest.
Sorry, something went wrong.
OK, closing. I will see instead about submitting documentation improvements.
No branches or pull requests
Go version
go version go1.21.5 darwin/arm64
What operating system and processor architecture are you using (
go env
)?What did you do?
From regexp/syntax:
https://go.dev/play/p/YKM2yyDC2Bm
Output:
What did you expect to see?
no error
What did you see instead?
Output:
The text was updated successfully, but these errors were encountered: