Daily Planner shortcut text matching help

Hi,

I have a Daily Planner Siri Shortcut that generally works well; but recently I have realized that I have some days where I don’t finish my prior day’s items and want to scrape the Daily Planner note (it’s in Bear) to find the unfinished ones and then, add them to today’s.

Here is a screenshot of my Shortcut (I know I should also work on updating the MIT variable vs creating three instances, any suggestions on that would be much appreciated too):

The patterns I am trying to match (as text based Markdown) are:

- [x] random completed task here

or

~~- [ ] text of some sort here~~

Where I want to remove the respective matched text pattern and only copy to the variable those items that are not completed, so look like:

- [ ] unfinished task example 1

Thank you in advance for all the great learning I have found over the years here and for your help.

Cheers,

Anthony

Always best to share a link to your shortcut that people can work with and an actual set of data - both sanitised of course to remove any personal data.

I have tried to accommodate various scenarios that are not explicitly covered by your listing, but it may well not cover everything. Here is an example shortcut that I think will get you most if not all of the way to doing what you want based on the description thus far.

The input text it uses is this:

- [x] random completed task here

~~- [ ] text of some sort here~~
Some random text interspersed with the tasks

- [ ] unfinished task example 1

- [x] random completed task here
~~- [ ] text of some sort here~~

Look, it's more text but is this an unmatched task on the same line - [ ] don't include me
- [ ] unfinished task example 1
	- [ ] unfinished sub task 1.1
		- [ ] unfinished sub task 1.1.1
	- [X] finished sub task 1.2
	- [ ] unfinished sub task 1.3

The result it gives is this:

~~- [ ] text of some sort here~~
- [ ] unfinished task example 1
~~- [ ] text of some sort here~~
- [ ] unfinished task example 1
	- [ ] unfinished sub task 1.1
		- [ ] unfinished sub task 1.1.1
	- [ ] unfinished sub task 1.3

Hope that helps.