是否有无论如何你可以做正则表达式匹配组使用sed像java正则表达式模式/匹配/组?sed - 如何做正则表达式组使用sed
如果我有串状
test-artifact-201251-balbal-0.1-SNAPSHOT.jar
我怎么用sed只是为了得到这样的结果:
test-artifact-0.1-SNASHOT.jar
我想知道做的sed允许你做的东西像Java正则表达式,你这样定义的模式:
([a-z]*-[a-z]*-)([0-9]*-)([a-z]*-)([.]*SNAPSHOT.jar)
,然后你可以得到的结果作为数组一样:
test-artifact-
201251-
balbal-
0.1-SNAPSHOT.jar
http://stackoverflow.com/questions/2777579/how-to-output-only-captured-groups-with-sed – 2015-10-07 13:42:10