原帖:处理前:
a trifle = [?s] a bit a little
处理后:
a trifle = [?s] a_bit a_little
处理规则:
将]后面的单空格转化为下划线。
-
awk -vRS=' +' '/\]/{k=1}k{RT==" "?RT="_":0}{printf $0RT}'
-
sed -r ':1;s/(\S) (\S[^]]+$)/\1_\2/;t1'
-
sed 'h;s/.*\]//;s/\b \b/_/g;x;s/\].*/\]/;G;s/\n//'
-
perl -pe '1 while(s/(\S) (\S[^]]+$)/$1_$2/)'
-
perl -pe 's/(?!.*\])\b (?=\S)/_/g'
-
:%s/\(.*\]\)\@!\(\S\)\@<=\( \)\(\S\)\@=/_/g
阅读(2634) | 评论(0) | 转发(0) |