Skip to content

Instantly share code, notes, and snippets.

@leotac
Created November 6, 2013 18:14
Show Gist options
  • Save leotac/7341211 to your computer and use it in GitHub Desktop.
Save leotac/7341211 to your computer and use it in GitHub Desktop.
Bibtex find and replace
#Find all occurrences of:
# - multiple lines -> \_.*
# - starting with ### -> ^###
# - not greedily (first match) -> use "\{-\}" instead of "*" (Valid in Vim! Generally, you would use ".*?" for non-greedy behavior)
# - ending with a @
# - and replace with a @
:%s/^###\_.\{-\}@/@/g
# This was a result of bibtool -s -d bib1.bib bib2.bib > bib.bib
# where we merge sorting entries (-s) and commenting duplicates (-d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment