views:

49

answers:

1

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 example but some generic techniques to generate strings that satisfy certain conditions.

Thanks a lot! Manuel

A: 

Check this: http://stackoverflow.com/questions/205411/random-string-that-matches-a-regexp

for good discussion and ideas. Thanks! Manuel

Manuel