« first day (35 days earlier)      last day (1292 days later) » 

8:43 AM
@Grimy Did you notice that I linked a text file above?
 
Oh right, I noticed and then forgot to look at it x)
 
I implemented a brute force search for that, but it only works up to 7 chars so far because 1) RME doesn't optimize things like (x*)*z yet, and 2) Once you start getting {NNN} and larger, without generalizing the treatment of it somehow, there would be too many sets of too large a size.
It didn't find anything that I hadn't already found manually.
 
Oh so up to 7 is definitely solved, cool
Err, clearly not very well solved though, since it’s missing \B
Which matches ~{1} in 2 chars
You currently have ~{1} in 5 chars with ^$|xx
 
9:02 AM
Yes, I hadn't added \b and \B yet to the brute forcer, and I just added them and it found that :) and then I came to this window and saw you noticed that too
 
\b i’m gonna conjecture is never needed
\B should find some other uses
 
The brute forcer doesn't find anything else with \B up to 7
@Grimy How can you say that, when one of your own regexes uses \b? (Floor logarithm in base 2)
Granted, that's a full function, not just true/false, but it could be used within a larger regex
Oh, maybe not, because in a larger regex you just want to capture something, not return it as a match
Hmmm
 
Yeah I’m not very confident about \b not being needed
z should be provably never needed for non-empty sets, though
* `z P` (where P is any pattern) is equivalent to `z` because P is never evaluated
* `P z` is also equivalent to `z`, since backtracking over P will reset all its capture groups
* `z|P` is equivalent to `P`
* `(?=z)` is equivalent to `z`
* `(?!z)` is equivalent to the empty pattern
z+ = z, z* = empty, z? = empty, (z) = z
And by recursively applying those rules it’s possible to convert any pattern containing a z into either a pattern that doesn’t contain z or just z
 
9:25 AM
I guess all the circumstances in which (?!) or (*F) are needed in PCRE are not applicable to ECMA.
 
Yeah backtracking verbs are what makes (?!) useful
If there are any backtracking verbs in P, P z is no longer equivalent to just z
Also recursion would make it much harder to prove anything with the above method
 
Oh, I missed a 9 char one: ^(?!x{N})
Oops never mind that
 
yeah
there’s shorter to match this set
 
I already realized that was covered by ^x{N,M}$
Probably should note things like that in the file
 
10:36 AM
@Grimy BTW, I verified your 379 length abundant numbers regex up to 10000 :)
 
 
2 hours later…
12:17 PM
What is the shortest regex to match even perfect numbers?
 
 
6 hours later…
6:17 PM
@H.PWiz I think it would check for the corresponding Mersenne prime.
Find a k for which 2^k-1 is prime (using logarithm in base 2) and 2^(k-1)*(2^k-1) equals the input.
 
7:05 PM
Yeah, I had a go, but I still don't have the hang of multiplication. Mine was60 long
 
i have 57
and 379 to match all perfect numbers
 
7:36 PM
wait no 53 not 57
^(?=(x(x*?))(\1\1)+$)((x*)(?=\5$))+(?!(xx+)\6+$)\1\2$
using log2 seems like it would be much longer
 
7:56 PM
Oh, of course log2 is not needed. I hadn't given it much thought. Very nice 53. I see how it works. :)
^
(?=(x(x*?))(\1\1)+$) # \1 = largest power of 2 divisor of tail; \2 = \1-1
((x*)(?=\5$))+ # tail = tail / \1 == largest odd divisor of tail
(?!(xx+)\6+$) # Assert tail is prime
\1\2$ # Assert tail == \1*2 - 1
I would suggest posting it as a noncompeting answer
Damn chat won't let me paste that as code, so it ate the spaces that align the comments
 
8:40 PM
 

« first day (35 days earlier)      last day (1292 days later) »