Skip to main content
added 815 characters in body
Source Link
Business Cat
  • 9.2k
  • 1
  • 17
  • 37

Retina, 36 33 bytes


%%%%
+`(^|\b)%
0$%'¶$%`1
11!`\d+

Try it online!

Explanation


%%%%

Replace the empty (non-existent) input with %%%%.

+`(^|\b)%
0$%'¶$%`1

On the first run of this stage, it will match ^% and essentially replace the text %%%% with the two lines 0%%% and 1%%%. The stage will loop until the output stops changing. On the second run, it will match \b% (since digits count as word characters and % doesn't), and replace the groups by duplicating them and adding 0 to one copy and 1 to the other: 0%%% becomes the lines 00%% and 01%% (and the same sort of thing for 1%%%). Through this loop all 16 bitstrings will be produced, linefeed separated.

11!`\d+

The first 11 matches of \d+ (a run of at least 1 digit) are retrieved. The matches are output in a linefeed-separated list.

Retina, 36 33 bytes


%%%%
+`(^|\b)%
0$%'¶$%`1
11!`\d+

Try it online!

Retina, 36 33 bytes


%%%%
+`(^|\b)%
0$%'¶$%`1
11!`\d+

Try it online!

Explanation


%%%%

Replace the empty (non-existent) input with %%%%.

+`(^|\b)%
0$%'¶$%`1

On the first run of this stage, it will match ^% and essentially replace the text %%%% with the two lines 0%%% and 1%%%. The stage will loop until the output stops changing. On the second run, it will match \b% (since digits count as word characters and % doesn't), and replace the groups by duplicating them and adding 0 to one copy and 1 to the other: 0%%% becomes the lines 00%% and 01%% (and the same sort of thing for 1%%%). Through this loop all 16 bitstrings will be produced, linefeed separated.

11!`\d+

The first 11 matches of \d+ (a run of at least 1 digit) are retrieved. The matches are output in a linefeed-separated list.

Source Link
Business Cat
  • 9.2k
  • 1
  • 17
  • 37

Retina, 36 33 bytes


%%%%
+`(^|\b)%
0$%'¶$%`1
11!`\d+

Try it online!