all: replace [0-9] with \d in regexps

1. replace [0-9] with \d in regexps
2. replace [a-zA-Z0-9_] with \w in regexps

Change-Id: I9e260538252a0c1071e76aeb1c5f885c6843a431
GitHub-Last-Rev: 286e1a4619
GitHub-Pull-Request: golang/go#54874
Reviewed-on: https://go-review.googlesource.com/c/go/+/428435
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@google.com>
This commit is contained in:
TomCao New Macbook Pro 2022-09-27 04:18:15 +00:00 committed by Gopher Robot
parent 550864e5d2
commit fac5338a6c
17 changed files with 23 additions and 23 deletions

View file

@ -1282,7 +1282,7 @@ func (p *Package) writeExportHeader(fgcch io.Writer) {
// They aren't useful for people using the header file,
// and they mean that the header files change based on the
// exact location of GOPATH.
re := regexp.MustCompile(`(?m)^(#line\s+[0-9]+\s+")[^"]*[/\\]([^"]*")`)
re := regexp.MustCompile(`(?m)^(#line\s+\d+\s+")[^"]*[/\\]([^"]*")`)
preamble := re.ReplaceAllString(p.Preamble, "$1$2")
fmt.Fprintf(fgcch, "/* Start of preamble from import \"C\" comments. */\n\n")