more defensive regular expressions