Clean up regexes across the board; replace leading spaces with tabs

Replacing spaces with tabs should have been a separate pull request, but I forgot to create a new branch.