Skip to main content
1 of 4
aaa
  • 486
  • 3
  • 10

You probably want to add something like this:

("l" "Insert a link with a cleaned-up description" entry (file "~/Dropbox/inbox.txt")
 "* [[%:link][%(replace-regexp-in-string \"^https?://\" \"\" (replace-regexp-in-string \"\\.[a-z0-9]+$\" \"\" \"%:link\"))]]"
 :prepend t)

This removes both the protocol and the extension. However, while that should work via just one regex, for some reason org-capture's processing hiccups when it sees a pipe in the regex, and doesn't perform the replacement. So instead I have to call replace-regexp-in-string twice.

Note that all those backslashes are necessary, including the double one.

aaa
  • 486
  • 3
  • 10