小编sud*_*roy的帖子

删除行中的所有空格,但不删除双引号之间的空格

例:

输入=

This is an example text with    some      spaces. 
This should be 2nd line.
However the spaces between "quotes    should not    change".
last line.
Run Code Online (Sandbox Code Playgroud)

输出=

Thisisanexampletextwithsomespaces. 
Thisshouldbe2ndline.
Howeverthespacesbetween"quotes    should not    change".
lastline.
Run Code Online (Sandbox Code Playgroud)

regex perl awk sed pattern-matching

5
推荐指数
1
解决办法
1493
查看次数

标签 统计

awk ×1

pattern-matching ×1

perl ×1

regex ×1

sed ×1