use regular expressions when possible