@Deadcode I feel like I don't have so much time to look at this stuff, which is a shame.
I just had a go at Lynch-Bell numbers, and came up with: 109, ^(?!(x{1,9})((x{1,9}(\1(x*))\4{8}(?=\5$))*(?=(x*)(\6{9})$)\7\1|(?!\1*$))((?=(x*)((\1\9){9}x*))\10)*(x{10})*$)
I haven't looked at your solution, but mine is certainly slower. I feel that mine is quite ugly also.
Shorter and faster with ^(?!(x{1,9})(((?=(x*)((\1\4){9}x*))\5)*(?=(x*)(\7{9})$)\8\1|(?!\1*$))((?=(x*)((\1\10){9}x*))\11)*(x{10})*$)
The idea is to, pick a digit, then check that either it's a non-divisor who appears in the input, or that it appears in the input, and appears to the right of itself in the input
So the check of whether it's to the right of itself can be done with the same code regex that checks with the non-divisor is in the input (i.e to the right of the end of the number)
@H.PWiz Do you think I should remove all the spoiler warnings from my posts? I feel they haven't done any good, and maybe they're preventing people from reading them at all who would enjoy reading them, but who would never actually get around to trying to solve the problem independently.
(the idea was to try to get more people interested in experimenting with unary regex themselves)
I don't know. I just uncovered the spoilers when reading these answers. There are plenty of things that I've figured out for myself, to discover everything from scratch isn't necessarily the most fun way to explore the capabilities of regex.
Something like that. Conceptually I'm just trying to pretend that I didn't really subtract off the digit when capturing \1. So I add a bunch of \1s in later to make up for it
@Deadcode There is this, which matches 0: ^(?!(x{0,9})(((?=(x*)((\1\4){9}x*))\5)*(?=(x*)(\7{9})$)\8\1|(?!\1*$))((?=(x*)((\1\10){9}x*))\11)*((x{10})+|(?!\1))$)
@Deadcode Right I've never tried to understand the division algorithm, can you show me a small regex that uses it? (and one that uses the generalized version)
Okay, the macro golf in your Lynch-Bell is that the second stage works both as "a second occurrence of the found digit" and as "the first occurrence of a non-divisor digit"