Python Regular Expression Matching Multiline Comments and Docstrings

preview_player
Показать описание
Topics

In this video you can find how to match single and multiline python comments and docstrings. Also you can find how to enable detection in PyCharm for broken and incomplete docstrings.

* Match Python single line comment
* Match Python single and multi-line docstrings
* PyCharm code inspection for broken and missing docstrings

comments

#.*\n

docstrings

"""[\s\S]*?"""

"""[\d\D]*?"""

"""[\w\W]*?"""

(['"])\1\1[\d\D]*?\1{3}

([^:]"""[^\(]*)"""

---------------------------------------------------------------------------------------------------------------------------------------------------------------
Bonus resources

---------------------------------------------------------------------------------------------------------------------------------------------------------------
Code store

Socials

Рекомендации по теме