2017-08-02 35 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