Using Groovy, I\'d like to generate a random sequence of characters from a given regular expression.
[A-Z0-9]
Here is a single line command/statement to generate random text string
print new Random().with {(1..9).collect {(('a'..'z')).join()[ nextInt((('a'..'z')).join().length())]}.join()}
or
def randText = print new Random().with {(1..9).collect {(('a'..'z')).join()[ nextInt((('a'..'z')).join().length())]}.join()}