1:29 AM
I need to implement a RegexMathEngine optimization that treats `(?!p)q` as `(?=q)(?!p)q` for expressions where it can know `q` will evaluate faster. But I've got to figure out how to show it in the debug trace.
And thanks :)

7 hours later…
8:56 AM

8 hours later…
4:51 PM
That’s a weird way to say “product of prime factors of N”
Done reading through it, gratz on the optimization!

Thanks :) I would really like to replace it with another answer that requires that virtualized-remainder-math trick, and I think your perfect powers problem would do nicely as a question that isn't just specialized to regexes. The numbers need a name though :) something referring to the perfect power hierarchy they contain.
Balance of power numbers? :)

5:10 PM
You mean the one where A, B are powers, (N-A) is a power of (N-B)?

Yep, that's the one.

4 hours later…
9:27 PM
-1 char and -1 group on “find the biggest prime factor”
`(?=((xx+)\2*(?=\2\$)|x*)*)`
And another -2 with `(?=((xx+)(?=\2+\$)|x*)*)`
Can drop the `|x*` for -3 if it doesn’t need to work for prime numbers
But special-casing primes costs me +5, so not worth it

9:52 PM
@Grimy Very nice! I would put a `+` in place of the last `*`

Done that
That causes it to fail for 1, saving another char
Because then we can change `x\$|` at start to `|x` at end

10:03 PM
@Grimy That's not what I meant... and no, it doesn't? You need `xx+` to do that, don't you?

Oh I meant the very last star

That doesn't make it fail for 1 either
Oh you mean the main loop?

Yeah

So you're at 131 now, right? And 120 with `(?*)`? (I haven't yet looked for where to do that)

131, 127 with (?*)
hah, 40 strikes again

10:13 PM
"Also I just got 130 with (?*)" <- so this was after you'd already gone lower than 141 without `(?*)`?

Well yeah, we were discussing a 137 right before that

Oops, misremembered. Yeah, I had the 136 at that point when you said that
But 136-130 = 6, and 131-127=4

So to rephrase... "Also I just got 130 with (?*)" <- so this was after you'd already gone lower than 136 without (?*)?

So only the former benefited from saving a capture group

10:18 PM
Ah
@Grimy How can that be? There was just one `\10` at that point
As there is now just one `\9`

Oh, I counted the `\9` in the comment
I dunno where the other char disappeared, then

Holy shit, just started analyzing the rest of your totient regex... `((x*)(?=\5\9*\$)x)` did you just optimize this form of division?!
This is huuuuge
why didn't you say something
this will drop bytes in many of my other regexes

Will it? I didn’t realize, that’s cool.

Aw damnit, github just broke my workaround for making things fill the width of the browser instead of being limited to a really narrow width.
`.container { margin-left:auto; margin-right:auto; width:2882px !important; }` - this doesn't work anymore

I just click raw x)

10:32 PM
For gists?
I designed this to require my workaround to be viewed in a sensible way

Oh not for gists no
This looks fine for me, except the “Robust solution” table requires h scrolling

For example "Robust solutions for Triples" is supposed to show each regex as a single unwrapped line
so you can at a glance see the differences in their length
But you're seeing them wrapped to up to 6 lines, right?

Right

10:52 PM
Ah, just have to apply the same to `.container-lg`

Here’s my current 131: pastebin.com/raw/yqpnzrwj. I’m sure there’s a way to save on that \5 computation, but I’m heading off to bed for now.

I replicated the 131 already, but it's the 127 I haven't
Goodnight :)

11:27 PM
(When I said "So you're at 131 now, right?" I was measuring the length of a working regex, not applying the -2 -3 stuff you said.)