|
|
1
2
这是你想要的,并摆脱不想要的
|
|
|
2
1
这里有一个可能的解决方案
|
|
|
3
0
好吧,这不是我最自豪的时刻,但我想它会满足你的需要…也许吧?我没办法
# cat blocks
block1
block2
block3
anotherblock4
anotherblock5
anotherblock6
lastblock7
lastblock8
# python -c 'import sys,re; print re.sub("(\n\n[\s\S]*?\n)(\n)", "\\1TEST\n\\2", sys.stdin.read(), 1),' < blocks
block1
block2
block3
anotherblock4
anotherblock5
anotherblock6
TEST
lastblock7
lastblock8
笔记:
或者,你可以用大头针
|
|
|
4
0
再一个
|