Hi Philippe,
I believe the Random String generators are using a random number generator, 
combined with some logic for generating codepoints.
But I can see the point for allowing it to generate regular expressions too. 
Might be useful to allow users to generate text from a regular expression too. 
Could you file an issue in JIRA for that?
Perhaps someone will volunteer to work on this. I would start by looking at the 
Builder in RandomStringGenerator, and at the TextRandomProvider interface. 
Perhaps you could create your own, using Generex, and send us the example to 
include in the website documentation?
I normally use [text] random string generator, or java faker [1]. However, I 
don't think java faker provides random values based on regular expressions.
Hope that helpsBruno
[1] https://github.com/DiUS/java-faker

      From: Philippe Mouawad <pmoua...@apache.org>
 To: Commons Users List <user@commons.apache.org> 
 Sent: Monday, 23 October 2017 7:34 AM
 Subject: Generate RandomString from a set of characters
   
Hello,
Is it possible in commons-text or commons-lang to generate a Random String
from:

- Either a range of characters defined in a regex ? [a-z][0-9] for example
- Either following a pattern (https://github.com/mifmif/Generex)


Thanks
Regards


   

Reply via email to