Regex
Generate matching and non matching strings based on regex patterns
Generate matching and non-matching strings. This is a java library that, given a regex pattern, allows to generation of matching strings. Iterate through unique matching strings. Generate not matching strings. Follow the link to Online IDE with created project: JDoodle. Enter your pattern and see the results. By design a+, a* and a{n,} patterns in regex imply an infinite number of characters should be matched. When generating data, that would mean values of infinite length might be generated. It is highly doubtful anyone would require a string of infinite length, thus I've artificially limited repetitions in such patterns to 100 symbols when generating random values. Use a{n,m} if you require some specific number of repetitions. It is suggested to avoid using such infinite patterns to generate data based on regex.