首页 > 解决方案 > Delete all lines that have a specific word in Pycharm

问题描述

Using Pycharm, I want to delete all lines that have a specific word. Does someone know how we can do that?

标签: pycharm

解决方案


使用正则表达式的替换功能(例如^.*hello.*$\n)匹配包含单词的整行(和\n)并将其替换为空:

在此处输入图像描述


推荐阅读