delete last blank line in the file

Can someone suggest an ansible regex that deletes the last blank line in a file, if it is blank.

TIA