regex for triple quote

后端 未结 5 678
我在风中等你
我在风中等你 2020-12-19 06:32

What regex will find the triple quote comments (possibly multi-line) in a Python source code?

5条回答
  •  青春惊慌失措
    2020-12-19 07:03

    Python is not a regular language and cannot reliably be parsed using regex.

    If you want a proper Python parser, look at the ast module. You may be looking for get_docstring.

提交回复
热议问题