面包店
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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. }