I'm formatting a multiple-choice quiz to be imported into an LMS. The questions are currently formatted like this, with the asterisk indicating the correct solution:
1. Question text
a. First answer
*b. Second answer
c. Third answer
d. Fourth answer
And I need to change the format to:
1. Question text
a. First answer
b. Second answer
c. Third answer
d. Fourth answer
Answer: b
One option is :g/^\*b\./norm x}OAnswer: b, but then I need run similar commands for a, c, and d to make sure I captured all the answers. It would be great if I could use backreferences, like :g/^\*\([a-d]\)\./norm x}OAnswer: \1 but I know backreferences won't work. I thought of yanking the correct answer's letter, }-ing down, and pasting it, but I'm drawing a blank as to how to write the commands to accomplish that. Any ideas?