golang 的 rabbitmq 消费项目
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.
 
 
 

12 lines
236 B

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