Split the regular expression mapping out into two database queries to improve efficiency.