How do I do a case insensitive regular expression in Go?

后端 未结 4 1147
粉色の甜心
粉色の甜心 2020-12-12 18:36

Now, of course, I could write my regular expression to handle both cases, such as regexp.Compile(\"[a-zA-Z]\"), but my regular expression is constructed from a

4条回答
  •  一个人的身影
    2020-12-12 19:30

    I'm not too familiar with Go, but according to this example: http://play.golang.org/p/WgpNhwWWuW

    You need to prefix your regex statement with (?i)

提交回复
热议问题