开发者

How can I generate strings that satisfy some restrictions?

开发者 https://www.devze.com 2022-12-17 18:32 出处:网络
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

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

0

精彩评论

暂无评论...
验证码 换一张
取 消