日期:2014-05-16 浏览次数:20859 次
[nicenight@CSDN ~]$ sed -nr '/^[0-9]/!b; s/^([0-9]+\.).*\([ ]*([a-z]+)[ ]*\)/\1 \2/; p' file.txt
1. a
2. n
[nicenight@CSDN ~]$ sed -nr '/^[0-9]/!bq; s/^([0-9]+\..*\([ ]*)[a-z]+([ ]*\))/\1 \2/; :q; p' file.txt
1. xxxx( )
A.
B.
2. xxx( )
A.
B.