Skip to content

Instantly share code, notes, and snippets.

@borwickatuw
Created October 23, 2023 16:41
Show Gist options
  • Select an option

  • Save borwickatuw/3f5c905f3902bb7bc55574f236178681 to your computer and use it in GitHub Desktop.

Select an option

Save borwickatuw/3f5c905f3902bb7bc55574f236178681 to your computer and use it in GitHub Desktop.
URLs that need escaping - perl one-liner
# This finds org-mode links that have slashes in them. I used this to find URLs that needed
# org-mode "escaping" with ='s around them (e.g. example.com/this/that/ --> =example.com/this/that/= )
# close ARGV if eof resets $. (the line number)
perl -lne 'print "$ARGV $.: $1" if m|(\[https:[^\]]+\]\[[^\]]+/.*?\])|; close ARGV if eof;' *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment