Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (15 sloc) 372 Bytes
title date tags slug disqus_identifier
How to use matching group in sed replacement
2018-02-03
debian
tips
sed-matching-group
/blog/sed-matching-group

With one capture group

sed -i 's/^Title\: \(.*\)$/title: "\1"/g' *.md

With more capture groups

sed -i 's|^Date: \([[:digit:]]\{4\}\)/\([[:digit:]]\{2\}\)/|date: \1-\2-|g' *.md