How can I generate strings that satisfy some restrictions?
Can anyone give me a hand with techniques to generate strings that satisfy certain restrictions.
For example, say I need to generate strings s and t such that
length(s) < length(t)
length(t) > 12
t contains at least 3 capital letters
and s contains a 2
And I don't mean this particular开发者_如何学Python example but some generic techniques to generate strings that satisfy certain conditions.
Check this: Random string that matches a regexp
for good discussion and ideas. Thanks! Manuel
精彩评论