Generate a String that matches a RegEx in Python [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Reversing a regular expression in python I think I ran into a problem that sounds easier than it is... I'm not too sure. I want to define a regular expression, and I want to build a number of strings matching it. Is there any module I can import that has got this functionality? Preferably not a brute-force approach using re.search or re.match . There must be a more elegant way to do that. 回答1: I've been working