Random string generator based on a Regular Expression template.