- Download Atom
- Find in buffer (aka CMD+F or similar)
- toggle
use regex
option - should look like.*
- enter commands below, and leave the replace box blank
options:
(\n\d+\n)
# any amount of numbers wrapped in new lines, should remove page numbers
(\d+(?!\.))
# match any number NOT followed by a punctuation mark - should be useful for not eliminating footnotes from source
#####Inline footnotes converted and requiring removal
(\n\d+\s.*)
# presumes that the footnotes will be separated by newlines AND that they begin with a numeral (rather than roman numerals)
#####lots of new line space
- this will be the last one to execute because Converted Journal Headers, page numbers, etc must be removed first, the latter with expressions above and the former with a manual find and replace
(\n\W\n)
# any non word wrapped in newlines
(\n.\n)
# any character wrapped in newlines
find and replace new lines with a space - useful for when calibre doesn't omit newlines as you'd like
.\n+.
# in find box, find any char followed by one of more newlines and followed by another char
$1
$2
# in the replace box, takes first matched char appends whitespace and next found char