2017-08-02 57 views
-1

我有一个降价的文字是这样的:如何通过shell优雅地解析Markdown中的URL?

this is a [sample1](http://sample1.com/) link. 
this is a [sample2](http://sample2.com/) link. 
this is a [sample3](http://sample3.com/) link. 
... 

我要输出这样的每一个环节:

sample1 http://sample1.com 
sample2 http://sample2.com 
sample3 http://sample3.com 

但我的代码很凌乱(使用grepsedawk和一些管道) ...

如何优雅地做到这一点?

回答

0

打印他们尝试此

(.*\[)(.*)(\]\()(http:.+)(\/\) link) 

See it here