Sample Header Ad - 728x90

Extract all links (including multiple links per line) in markdown file

0 votes
2 answers
572 views
## Sample markdown file:
cat index.md

# Abstract

- To achieve [Work Life Balance](./WorkLifeBalance/WorkLifeBalance.md), first understand what it means and what are the requirements.
- Develop right **[Attitude](./Attitude/index.md)** and [Haha](./Haha/Haha.md).
- Understand **[attention](./AttentionManagement/index.md)**, **[time](./TimeManagement/index.md)** and **[task](./TaskManagement/index.md)** management and start implementing those.
## Expected outcome
[Work Life Balance](./WorkLifeBalance/WorkLifeBalance.md)
[Attitude](./Attitude/index.md)
[Haha](./Haha/Haha.md)
[attention](./AttentionManagement/index.md)
[time](./TimeManagement/index.md)
[task](./TaskManagement/index.md)
# Attempts to solve sed -r -n -e 's/.*(\[.*\]\(.*\)).*/\1/p' index.md, but this only mnatches the last link in a line! # Suggestions? I prefer sed, but if its not possible in sed then other tools are also welcome.
Asked by Porcupine (2156 rep)
Jul 18, 2022, 03:00 PM
Last activity: Jul 18, 2022, 04:37 PM