I wanted to replace all instances of: _4626-550x367.jpg with: _-\d{3}x300 OR _-\300xd{3}
Step 10:
find:
replace:
Step 9: …
Find:
Replace:
Step 8: Yes this could be more efficient, replace the remaining html images
Find:
Replace:
Step 7: Replace other image linksNotepad++ againFind:
Replace:
Step 6: Replace featured_image frontmatter with updated link
Using Notepad++ regex search, with ”. matches newline” ticked
Find:
Replace:
Step 5: Use FTP to download uploads from Wordpress install, and replace links in the markdown
Using Notepad++ regex search, with ”. matches newline” ticked
Replace:
This might leave behind some duplicates (for me at least, I had embeds followed by download buttons).
Step 4: Replace ‘categories’ with tags (because Obsidian can only handle one ‘tag’ type field)
This’ll do it:
Step 3: Ensure the url string follows the : in the footnote:
Find: (?<!\r[[:blank:]]|\n[[:blank:]])(\[\^)(\d+)(]:)(\n|\r|\R)(\S+)
Replace: \1\2\3 \5
Step 2: Replace footnotes not preceded by a newline using:
Find: (?<!\r[[:blank:]]|\n[[:blank:]])(\[\^)(\d+)(]:)
Replace: \r\1\2\3\4
Step 1: Replace footnotes with [\d] form with [^\d] form
Find: (\[)(\d+)(])
Replace: \[\^(\2)]
Step 0: First I used either the Wordpress export to Hugo plugin or the Wordpress export to Gatsby…I’ve forgotten. The markdown was pretty messy, so I ran the below (and then the regex above using notepad++…I forget which of these two: