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:
* [] social practices and mediation * [] appropriating mediational means
I have the first bit of code here:
$inLinks=exportedString(this,"/System/Export/inlink"); $inLinksTrans=$inLinks.replace('<a href="',"");
However, I’m not sure how to construct the next two regexes. Basically, I want to do the following:
- remove .html and everything after it on each line
- find each 12 digit number and wrap it in [[ ]]
Would love some guidance from an expert if anyone has the time. Thanks!