Regex 正则表达式将新行和空格替换为空格
我有一根这样的绳子Regex 正则表达式将新行和空格替换为空格,regex,pspad,Regex,Pspad,我有一根这样的绳子 -U, --update Update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed) -i, --ignore-errors
-U, --update Update this program to latest version. Make
sure that you have sufficient permissions
(run with sudo if needed)
-i, --ignore-errors Continue on download errors, for example to
skip unavailable videos in a playlist
--abort-on-error Abort downloading of further videos (in the
playlist or the command line) if an error
occurs
我的目标是将其转化为:
-U, --update Update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed)
-i, --ignore-errors Continue on download errors, for example to skip unavailable videos in a playlist
--abort-on-error Abort downloading of further videos (in the playlist or the command line) if an error occurs
使用正则表达式
我猜想
-U, --update Update this program to latest version. Make
sure
与-U,--更新此程序至最新版本相同。创建
+新行+一定数量的空格。所以要替换这个,我需要用空格替换新行\n
+()
但它并不能取代它
什么是正确的正则表达式(我正在使用pspad)我不知道pspad的细微差别,但下面的查找和替换似乎有效:
Find: \n[ ]+
Replace: (nothing)
注意,上面的模式只匹配行末尾的换行符,这些行后面有一个续行,续行在开始处填充一个或多个空格。模式与给定解释中的最后一行不匹配。我不知道pspad的细微差别,但以下查找和替换似乎有效:
Find: \n[ ]+
Replace: (nothing)
注意,上面的模式只匹配行末尾的换行符,这些行后面有一个续行,续行在开始处填充一个或多个空格。模式与给定解释中的最后一行不匹配