Does go regexp's any charcter match newline

前端 未结 1 987
走了就别回头了
走了就别回头了 2021-01-12 23:43

Go\'s re2 syntax document says that the any character(.) matches any character, including newline (s=true). However I wrote a simple program whose result showed that the any

相关标签:
1条回答
  • 2021-01-13 00:31

    Like most other (all?) regex engines, dot does not match newlines unless you add the "dot all" flag (?s) to the regex.

    I tested this using your link and it worked.

    0 讨论(0)
提交回复
热议问题