How do I use regular expression to delete unused script lines?

image

For example, in that image, if I wanted to delete the unused lines with no words, how would I go about that?

WOAH, that’s a lot of names, but currently no solution : (

maybe try string.sub on the source