« first day    last day (1327 days later) » 

2:51 AM
@Grimy Hello :) I've changed my mind, I would like to see your logarithm regexes, please! And I understand how your 66 char one works now :)
 
 
4 hours later…
7:17 AM
log2 65: (?=(x*)\1)(?=((?=xx(x*)(?=\1)\3(((x*)(?=\6$)x)*$))\4)*)\3(\Bx|\1)
log2 63: (?=(x*)\1)((?=((?=xx(x+)(?=\1)\4(((x*)(?=\7$)x)*$))\5)+)\4x|\1)
log2 64: (?=(x*)\1)((?=((?=(x?(x+)(?=\1)\5)(((x*)x(?=\8$))+$))\6)+)\4|\1)
log2 60: (?=(x*)\1)(?=((?=(x(x*)(?=\1)\4x?)(((x*)x(?=\7$))+$))\5)*)\3
log2 57: (?=(x+)\1)(?=((?=(x+)(?=\1)\3(((x*)(?=\6$)x)+$))\4)*)\3x|

truncated log2 76: (?!(x*)(\1\1)+$)(?=(x+)\3)(?=((?=(x+)(?=\3)\5(((x*)(?=\8$)x)+$))\6)*)\5x|\b$

log10 105: (?=((x*)\2{8}(?=\2$))+x$)(?=(x+)\3\3)(?=((?=(x+)\5(?=\3)\5(((x*)\8{8}(?=\8$))+)x$)\6{9})*(x*)\9{8})\9x|x$
 
7:29 AM
Wow, awesome! Thank you :)
And (?!(x*)(\1\1)+$) a synonym for (?!(x(xx)+)\1*$), I didn't even consider that!
Both the same length
Except... holy crap
Your new one doesn't match 0
That's fantastic
The other one needed to be modified to (?!(x(xx)+|)\1*$) to not match zero.
Do you want to see mine?
 
Your log2 regex? Didn’t I already see that?
 
I mean my floor log2
 
Oh, sure
 
and my number-of-digits log10
and my logN
Did you do a logN?
 
hmm not log N
I didn’t make one yet, so I don’t want to see yours yet
 
7:34 AM
Alrighty
 
I’m off
 
Okay, thanks for the regexes!
Emailed you my log2 and log10 ones.
 
 
10 hours later…
5:52 PM
Back! Yeah, I can confirm our floor log 2 approaches are completely different. I just assert N is a power of 2, then re-use the regular log 2 regex (causing the match to not be at the start of the string). You actually do math on the arbitrary input.
0
A: Is this number a repdigit?

GrimyRegex (ECMAScript), 31 bytes ^(x{0,9})((x+)\3{8}(?=\3$)\1)*$ Takes input in unary, as usual for math regexes (note that the problem is trivial with decimal input: just ^(.)\1*$). Explanation: ^(x{0,9}) # \1 = candidate digit, N -= \1 ( # Loop the following: (x+)...

 
6:48 PM
@Grimy Welcome back :) Yes, I saw that. And in my "(version 6)" you can see I tried your approach, guessing in advance it was what you used, and got a worse result than my actual-math approach.
er, not version 6
I mean "regex for doing floor logarithm in base 2 (version 3 - alternative longer).txt"
But silly me, the .*? was not necessary since it wasn't anchored (which I seem to have forgotten)
Yep, the correct approach gets 91 chars, beating my math-based 93: (?=(?!(x*)(\1\1)+$)(?=(x*)\3)(x(?=((?=(x*)(?=\3)\6(x*?)(((x+)(?=\10$))*x$))x\8)‌​+)x\7|\3))\4
Though I didn't know about the alternative negative-lookahead power-of-2, so I would've gotten 92 instead, I suppose.
Thing is, in the context of actually using it in a larger regex, this approach would be 91+3=94 chars, or 76+3=79 chars, due to the required .*?.
 
 
5 hours later…
11:51 PM
I added your (?!(x*)(\1\1)+$) and its higher-power equivalents to my Powers of various bases table and implemented optimization of it for powers of 2.
 

« first day    last day (1327 days later) »