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.

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Manuel Araoz
  • 15,962
  • 24
  • 71
  • 95
  • 1
    related: http://stackoverflow.com/questions/205411/random-string-that-matches-a-regexp – moonshadow Jan 20 '10 at 11:03
  • Smells like homework, is this homework? – Binary Worrier Jan 20 '10 at 11:06
  • related, from same user: http://stackoverflow.com/questions/2100803/how-can-i-generate-integers-that-satisfy-some-restrictions – Rubens Farias Jan 20 '10 at 11:08
  • Not homework. I just need to generate strings and integers satisfying some conditions and haven't found any better techniques than Boundary value analysis and equivalence partitioning. Those don't seem enough, so I'm asking to know if someone with more experience in this matters can guide my research. Thanks! – Manuel Araoz Jan 20 '10 at 11:13

1 Answers1

0

Check this: Random string that matches a regexp

for good discussion and ideas. Thanks! Manuel

Community
  • 1
  • 1
Manuel Araoz
  • 15,962
  • 24
  • 71
  • 95