This can be very slow and may freeze your browser for long or complex expressions.

Help

There are two forms of line in xeger:

  1. Regular expressions, which create streams of all matching strings (generators)
  2. Filtering lines, which select or modify the sentences in a stream (filters)

The regular expressions support the standard *|()+?{}[] features, as well as intersection analogous to | using &. Pre-defined character groups exist for alphabetic ASCII [:a]/[:A] and digits [:0], and their combinations [:a0], [:Aa], etc; they also exist for consonants [:c] and vowels [:v]. Elements of these classes can be excluded with ^ [:a^hj] or added on the end [:v:y]

Filtering lines start with a character indicating the type of filter:

Filters apply to the sequence from the first line not already used. Filters (but not generators) may include numbered backreferences.

Any instance of @num expands the current expression into a sequence with every element of the output from line num. @num# gives the length of each line instead.

@X creates an input called X for the user to provide, with the same substitution rules. 1{@X#} gives 1 repeated X times for each line of X.

The sequence from the last line is given as output, one per line

Samples