Basically what I would want to do is copy a URL (e.g. https://habitica.fandom.com/wiki/Habitica_Wiki) and then use a TextBlaze shortcut to paste the above Markdown in its entirety. I know there is a clipboard command, but is there a way to also extract the last part of the URL (e.g. "Habitica_Wiki"), remove the underscore, and put that in brackets before the URL?
The key item here is the formula command {=}. Text Blaze formulas let you do data manipulation like in Excel. You can learn more here:
The extractregex() function in a formula allows you to grab a specific part of what's in the clipboard. For example, the ".*/(.+?)$" regular expression here means: "get everything after the last '/' to the end of the clipboard". We then use the replace() function to replace all occurrences of underscores with spaces.
Something like this should work: ".*(?:/|#)(.+?)$". We changed the "/" to a "(?:/|#)". "(/|#)" means match a "/" or a "#". The "?:" in front of it means this isn't the group we want to extract from the function.