Skip to main content
added 119 characters in body
Source Link
grep -Pno "[[[:alnum:]]*]\(.*?\)" /path/to/file.md 

OR even better( this would match even ["foo anotherword"])

grep -Pno "\[([[:alnum:]]*[[:space:]]*)*?\]\(.*?\)" 

-P => Perl Regex which is used to match non-greedy using ?

OR if don't want only alpha numeric and space but any character means

 grep -Pno "\[.*?\]\(.*?\)" 
grep -Pno "[[[:alnum:]]*]\(.*?\)" /path/to/file.md 

OR even better( this would match even ["foo anotherword"])

grep -Pno "\[([[:alnum:]]*[[:space:]]*)*?\]\(.*?\)" 

-P => Perl Regex which is used to match non-greedy using ?

grep -Pno "[[[:alnum:]]*]\(.*?\)" /path/to/file.md 

OR even better( this would match even ["foo anotherword"])

grep -Pno "\[([[:alnum:]]*[[:space:]]*)*?\]\(.*?\)" 

-P => Perl Regex which is used to match non-greedy using ?

OR if don't want only alpha numeric and space but any character means

 grep -Pno "\[.*?\]\(.*?\)" 
deleted 2 characters in body
Source Link
grep -Pno "[[[:alnum:]]*]\(.*?\)" /path/to/file.md 

OR even better( this would match even ["foo anotherword"])

grep -Pno "\[[["\[([[:printalnum:]]*[[:space:]]*)*?\]\(.*?\)" /path/to/file.md 

-P => Perl Regex which is used to match non-greedy using ?

grep -Pno "[[[:alnum:]]*]\(.*?\)" /path/to/file.md 

OR even better( this would match even ["foo anotherword"])

grep -Pno "\[[[:print:]]*?\]\(.*?\)" /path/to/file.md 

-P => Perl Regex which is used to match non-greedy using ?

grep -Pno "[[[:alnum:]]*]\(.*?\)" /path/to/file.md 

OR even better( this would match even ["foo anotherword"])

grep -Pno "\[([[:alnum:]]*[[:space:]]*)*?\]\(.*?\)" 

-P => Perl Regex which is used to match non-greedy using ?

added 10 characters in body
Source Link
grep -Pno "[[[:alnum:]]*]\(.*?\)" /path/to/file.md 

OR even better( this would match even ["foo anotherword"])

grep -Pno "\[.*"\[[[:print:]]*?\]\(.*?\)" /path/to/file.md 

-P => Perl Regex which is used to match non-greedy using ?

grep -Pno "[[[:alnum:]]*]\(.*?\)" /path/to/file.md 

OR even better( this would match even ["foo anotherword"])

grep -Pno "\[.*?\]\(.*?\)" /path/to/file.md 

-P => Perl Regex which is used to match non-greedy using ?

grep -Pno "[[[:alnum:]]*]\(.*?\)" /path/to/file.md 

OR even better( this would match even ["foo anotherword"])

grep -Pno "\[[[:print:]]*?\]\(.*?\)" /path/to/file.md 

-P => Perl Regex which is used to match non-greedy using ?

added 53 characters in body
Source Link
Loading
Source Link
Loading