面包店
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

9 月之前
1234567891011
  1. package md
  2. import (
  3. "regexp"
  4. )
  5. func ReplaceImgUrl(val, host string) string {
  6. pattern := "\"([" + `\w` + ".=-\u4e00-\u9fa5]+).(png|jpg|jpeg|gif)"
  7. r := regexp.MustCompile(pattern)
  8. return r.ReplaceAllString(val, `"`+host+"/$1.$2")
  9. }