Build: Fix regex that removes empty definitions