又没有可能是你的`getContent()`内容未转译? 我按照你的方式在本地直接使用字符串是可以匹配的; package main import ( "fmt" "regexp" ) func main() { const str = `tetsdfdsf ## Contents - [test](#test) - [Contents](#contents) - [test2](#test2) - [fdf and dfdf](#dfdf-and-dffd) - [dfdf](#dfdf) - [dfdf Building](#dfdf-building) - [Build dfdf](#build-dfdf) - [dfdf Line](#df-dfd) - [dfd dfdf dfd](#advanced-console-dfd) - [dfdf dfdf](#standard-cli) - [dfdf](#configuration) - [Continuous Integration](#continuous-integration) - [dddd Preprocessors](#dddd-preprocessors) **[⬆ back to top](#contents)** ` reg := regexp.MustCompile(`Contents\n\n(.|\n)+?\n\n`) fmt.Printf("%#v", reg.FindSubmatch([]byte(str))[0]) } 