randomRegexpishString

Returns a String that's "regexpish" (contains lots of operators typically found in regular expressions) If you call this enough times, you might get a valid regex!


fun randomRegexpishString(r: Random, maxLength: Int): String

Returns a String that's "regexpish" (contains lots of operators typically found in regular expressions) If you call this enough times, you might get a valid regex!

Note: to avoid practically endless backtracking patterns we replace asterisk and plus operators with bounded repetitions. See LUCENE-4111 for more info.

Parameters

maxLength

A hint about maximum length of the regexpish string. It may be exceeded by a few characters.