Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
regex [2021/03/20 20:52] – [Useful regular expressions] maartenregex [2024/02/14 12:20] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Useful regular expressions ====== ====== Useful regular expressions ======
  
-A relatively advanced way to potentially semi-automate a few processes is the use of regular expressions. These are basically an advanced form of “find and replace” which can be very powerful. When used properly, they can clean up certain code and properly format things like footnotes in record time, or convert square bracket<sup>''[1]''</sup> style footnotes to without<sup>''1''</sup> for print, and vice versa. For example, from the final Wellred InDesign book to [[publishing:digital:ebook|EPUB export]], we can now often achieve a 100% finished ebook in less than an hour thanks to a series of regular expressions executed at once.+A relatively advanced way to potentially semi-automate a few processes is the use of regular expressions. These are basically an advanced form of “find and replace” which can be very powerful. When used properly, they can clean up certain code and properly format things like footnotes in record time, or convert square bracket<sup>''[1]''</sup> style footnotes to without<sup>''1''</sup> for print, and vice versa ((Concretely, you would look for something like ''class="noteref">(.*?)</a></sup>'' and replace this with something like ''>[\1]</a></sup>'')). For example, from the final Wellred InDesign book to [[publishing:digital:ebook|EPUB export]], we can now often achieve a 100% finished ebook in less than an hour thanks to a series of regular expressions executed at once.
  
 The easiest way to understand the concept is to use a simple one. A fairly typical export from InDesign will have Headers as a paragraph tag, which isn't much use for HTML/EPUB: The easiest way to understand the concept is to use a simple one. A fairly typical export from InDesign will have Headers as a paragraph tag, which isn't much use for HTML/EPUB:
Line 27: Line 27:
 https://regex101.com/ is a useful resource to try out certain patterns. https://regex101.com/ is a useful resource to try out certain patterns.
  
-MV's file {{ ::regex-mv.rtf |}} used for producing ebooks may be useful to get a better idea, and below are some further examples.+MV'plain text file {{ ::regex-mv.pdf |}} used for producing ebooks may be useful to get a better idea
 + 
 +Below are some further examples.