123456789101112131415161718192021222324 |
- package main
- import (
- "fmt"
- "regexp"
- )
- func main() {
- html := `aaaaaaaa
- <link rel="stylesheet" href="https://example.com/wp-content/themes/my-theme/style.css" type="text/css" media="all">
- aaaaaaaaaaa`
- re := regexp.MustCompile(`wp-content\/themes\/(.+?)\/`)
- result := re.FindStringSubmatch(html)
- if len(result) > 1 {
- themeName := result[1]
- fmt.Println(themeName)
- } else {
- fmt.Println("Theme name not found")
- }
- }
|