Skip to main content
1 of 9

dc, regex length 12

^[^# !]{59}$ 

This regular expression is simple enough that I don't think the flavor of regex matters -- it should work across the board. (Note the space after the # in the regex.)

The dc program takes its input on stdin and puts its output on stdout.

Sample output for input 4 (there's a trailing space at the end of each line):

1 2 3 4 8 7 6 5 9 10 11 12 16 15 14 13