I am working on an Action that is supposed to transform text in this format:
- Mow the lawn
to this format:
- [ ] #n/task Mow the lawn for {{ProjectName}} #s/scheduled
The regex script I’m using is:
const findRegex = /^- (.)*?/gm;
// define replacement expression...
const replaceWith = "- [ ]\#n/task $1 for \{{VacationName}} \#s/scheduled";
This works except that the $1 capture group is placed at the end of the reformatted task. Like this:
- [ ] #n/task for {{ProjectName}} #s/scheduled Mow the lawn
What change do I need to make to the replacement expression to relocate the capture group to the proper position within the reformatted task, as opposed to its being moved to the end of the reformatted task?