What I’m trying to do
I have lots of notes that include parts like this:
---
cr:
---
**Challenge Rating:** 1/4 (50 XP)
I want to use Linter to insert “1/4” (or whatever the respective value is for each note) in the frontmatter, after cr:
(it’s a bunch of D&D monsters in .md format, but sadly the statblock notes don’t make use of frontmatter properties, which would be super useful for searching and filtering with dataview)
Things I have tried
While I’m able to match “cr:” and "the bit after Challenge Rating:** individually, I’m struggling to take one group and insert it after the other match using Linter’s replace input mask. (I also haven’t been able to find out how to do it in regex101)
(?<=Rating:\*\*)(.*)(?=\()
catches the actual challenge rating. That’s about as far as I got
I’d be grateful for any pointers, I have only done the most basic of RegEx before.
P.S. (As I’m looking at it now, I may have to convert fractions (1/4, 1/2) into numbers, but that’s easy enough)