Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save fabiolimace/4a30b78eb8b997bdf03e8d01a9a558d7 to your computer and use it in GitHub Desktop.

Select an option

Save fabiolimace/4a30b78eb8b997bdf03e8d01a9a558d7 to your computer and use it in GitHub Desktop.
Regex replace rules to convert an ebook from EPUB to TXT
\b([0-9]+)[.]?<sup[^>]*>a</sup>
\1ª
\b([0-9]+)[.]?<sup[^>]*>o</sup>
\1º
\[(<a[^>]*></a>)?<a[^>]*>[0-9]+</a>\]
\b([0-9]{4})-([0-9]{4})\b
\1–\2
(\b[[:alpha:]]+[’”»]?[.,;:!?…])(<span>)?<a[^>]*>[0-9]+</a>(</span>)?
\1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment