Maybe a couple of lines like this would suffice?
draft.content = draft.content.replace(/(^\s*-.*?)(\s@.*)$/gm, "$1");
draft.update();
If you add this to a script step, the JavaScript above, when run on a Taskpaper draft like this:
Project 1:
- Some task @tagged
- Some double tagged task @tagged @taggedagain
- Some other task @completed 2020-04-11 @anothertag
Project 2:
- Untagged task
- Tagged sub task with a tag @tag
Notes with @tags in them
- This one has an e-mail@address.com in it
- This one has a quoted "@Twitter_handle"
Project 3 - all about @tags:
- Another task @tagged
Will strip it down to look like this:
Project 1:
- Some task
- Some double tagged task
- Some other task
Project 2:
- Untagged task
- Tagged sub task with a tag
Notes with @tags in them
- This one has an e-mail@address.com in it
- This one has a quoted "@Twitter_handle"
Project 3 - all about @tags:
- Another task
Note this example includes tags in notes and project sections, as well as other uses of the at symbol such as for e-mail addresses and user handles.
The regular expression match looks for task lines only (lines starting with whitespace followed by a hyphen), and then match the first white space and at symbol (for a tag) that follows, and all the way to the end of the line. That match is then wiped by replacing the content with everything that precedes the whitespace and at symbol.
That leaves in place @ symbols in e-mail addresses (as they won’t be preceded by whitespace, and any tags referenced in projects and notes.
If you need to include any at mentions (e.g. a Twitter handle or an Office 365 user reference), I would recommend putting these in quotes (single, double, back tick - whatever works for you), so that they don’t get flagged up as being a tag for the purposes of this reset (because the at symbol is not immediately preceded by whitespace).
Is that anything like close to what you’re after?