regexp是golang标准库自带的正则校验包,使用:

re, _ := regexp.Compile(`(\d+)年(\d+)月`) //判断是否匹配category类别搜索
ismatch := re.MatchString(tag)

校验某字符串是否符合"xx年xx月"格式,over。。。

相关文章:

  • 2021-07-15
  • 2021-12-29
  • 2021-05-29
  • 2022-12-23
  • 2021-10-02
  • 2017-12-04
  • 2021-07-06
  • 2021-12-21
猜你喜欢
  • 2021-11-22
  • 2021-11-08
  • 2022-12-23
  • 2022-12-23
  • 2019-10-08
相关资源
相似解决方案