use regular expressions in makepalin instead of simple string checking