made regex for filename more flexible (closes #252)