How to generate a string from a Regular Expression?