Related to my Zettelkasten file export project, I’m trying to see if I can use Regex to format lists of outbound and inbound links to the the wiki formatting and send that to an attribute for export. I’m mainly only good at adapting regexes though, I don’t know enough to write them from scratch at this point.
Here’s some sample data:
* <a href="201906061128 social practices and mediation.html">social practices and mediation</a>
* <a href="201906061114 appropriating mediational means.html">appropriating mediational means</a>
What I want to achieve is this:
* [[201906061128]] social practices and mediation
* [[201906061114]] appropriating mediational means
Ok, another complication. I’m trying to use an agent to assign this action to notes that have inbound links. The agent is in the root container, while the original notes are in another container. What I’m getting now is some extra path information in the replaced text:
* ../Container-Name/[[201906061128]] - social practices and mediation
Is there a way to programmatically figure out what the container name is and strip it out with the regex?
Or, I suppose the easier way around is just to chain another .replace to the end to excise everything between a period and a forward slash …