Clean up formatting.c's logic for matching constant strings