How to create random strings using regex?

Hi, I am trying to generate random strings with particular pattern. But i m not able to proceed here…

Read this, see if it helps:

Russ Thomas said:

Read this, see if it helps:

https://stackoverflow.com/questions/8138164/groovy-generate-random-string-from-given-character-set

If i want to use a regex something like ^[a-z0-9]{0,8}±[a-z0-9]{0,4}±[a-z0-9]{0,4}±[a-z0-9]{0,4}±[a-z0-9]{0,12}+$. This wont support

No, because regex is meant for matching -- personally, I would not use regex for this kind of problem (hence my original, abnormally terse response). All my random strings are generated by using:

import org.apache.commons.lang.RandomStringUtils

Perhaps you could search duckduckgo for that and then build your own algorithm in groovy.