Making the create_tags method more sophisticated with regular expressions