diff --git a/src/regexp/regexp.go b/src/regexp/regexp.go index f4395404822..e06099425eb 100644 --- a/src/regexp/regexp.go +++ b/src/regexp/regexp.go @@ -14,10 +14,7 @@ // guaranteed to run in time linear in the size of the input. // (This is a property not guaranteed by most open source // implementations of regular expressions.) For more information -// about this property, see -// -// https://swtch.com/~rsc/regexp/regexp1.html -// +// about this property, see https://swtch.com/~rsc/regexp/regexp1.html // or any book about automata theory. // // All characters are UTF-8-encoded code points. @@ -54,14 +51,13 @@ // subexpression did not match any string in the input. For 'String' versions // an empty string means either no match or an empty match. // -// There is also a subset of the methods that can be applied to text read -// from a RuneReader: -// -// MatchReader, FindReaderIndex, FindReaderSubmatchIndex +// There is also a subset of the methods that can be applied to text read from +// an [io.RuneReader]: [Regexp.MatchReader], [Regexp.FindReaderIndex], +// [Regexp.FindReaderSubmatchIndex]. // // This set may grow. Note that regular expression matches may need to // examine text beyond the text returned by a match, so the methods that -// match text from a RuneReader may read arbitrarily far into the input +// match text from an [io.RuneReader] may read arbitrarily far into the input // before returning. // // (There are a few other methods that do not match this pattern.) @@ -537,7 +533,7 @@ func (re *Regexp) Match(b []byte) bool { return re.doMatch(nil, b, "") } -// MatchReader reports whether the text returned by the RuneReader +// MatchReader reports whether the text returned by the [io.RuneReader] // contains any match of the regular expression pattern. // More complicated queries need to use [Compile] and the full [Regexp] interface. func MatchReader(pattern string, r io.RuneReader) (matched bool, err error) { diff --git a/src/strings/strings.go b/src/strings/strings.go index 52a715c66b4..0bd3c1c2337 100644 --- a/src/strings/strings.go +++ b/src/strings/strings.go @@ -286,7 +286,7 @@ func SplitN(s, sep string, n int) []string { return genSplit(s, sep, 0, n) } // - n < 0: all substrings. // // Edge cases for s and sep (for example, empty strings) are handled -// as described in the documentation for SplitAfter. +// as described in the documentation for [SplitAfter]. func SplitAfterN(s, sep string, n int) []string { return genSplit(s, sep, len(sep), n) }