« first day (5 days earlier)      last day (1322 days later) » 

6:03 AM
Hey guys! @Grimy, this is absolutely brilliant! What a fantastic revelation, and quite possibly one of the biggest PCRE discoveries ever
So I guess this means something like (?=([\s\S]+))((?<=(?=X\g{-2}\z|(?-1)|[^\s\S])[\s\S])) can be used to completely emulate (?<=X) for variable-length 'X'? Awesome
(oh, that should be [\s\S]* at the start there*)
 
6:59 AM
Longest word in a string fully functional: \b(\w++)(?=([\s\S]*))(?!.*\b\w++(?=([\s\S]*))((?<=(?=(?=\1\2\z)(?:(?=.*\b(\5?+\‌​w)\w*+\3\z)\w)++\b|(?4)|[^\s\S]).)))
Fun new toy haha
@Grimy if you're not planning to publish this formally anywhere, would you mind terribly if I wrote it up and put it on drregex.com? With profuse crediting to yourself, of course. The regex world needs to see this!
 
7:29 AM
@jaytea Sure, that would be fine!
Also you can save a bunch of chars by using (?s) at the start and replacing all [\s\S] with .
 
Good idea!
And $x should be a contradiction in all contexts, if I'm not mistaken. in place of [^\s\S]
no matter how you cut it, it's going to look a little "wtf" at first glance :p
 
7:54 AM
Hey, there's no need to use [\s\S]. \X does the same.
So (?s) only wins if you use . more than three times. Less than three, \X wins.
 
Golf addict!
hey David :P
 
hiya John :)
What the heck. The chat is not letting me enter a certain sentence.
 
how the devil are you
Haha. Mime it
 
Great! I'm working on Grimy's no-(?*) challenge right now. How're you? :)
@jaytea Yes, .^ and $. are the shortest equivalents of (*FAIL).
that is what I was trying to say. The chat refused that line three times. Now it accepted it.
Wow, I just realized simply pressing Up when the current line is blank edits previous spoken lines (then Up/Down scrolls through choosing which one to edit).
@jaytea I was thinking the same, but I wanted to wait for you to say it :)
 
8:16 AM
Ah but "$x" fails regardless of the set status of (?m)
By all means post about it on SO :P Let's get the word out!
 
@jaytea So do .^ and $., as long as (?s) is not set.
But yes, I see your point. In (?ms) mode, $x or x^ is the way to go.
 
Yeah
@Grimy, how would one introduce you? :p
Any personal webpage or anything you want linked?
 
Err, my github I guess? Otherwise just Grimy is fine.
Also \X isn't the same as [\s\S]
\C works if you're using a fixed-length encoding (so not UTF-8)
 
@Grimy When does it behave differently?
 
When you have extended grapheme clusters that contain more than one character
Which happens in some asian scripts and when using combining diacritics
Oh \X will also match a whole CRLF at once, whereas [\s\S] will only match one of CR or LF at a time.
 
8:33 AM
I see. Good catch.
Is [^\p{Cn}] any different from [\s\S]? :-)
 
8:56 AM
Yeah, clearly
It's gonna be a while until Unicode assigns all code points
 
 
3 hours later…
11:38 AM
@Grimy Okay, solved it in pure ECMA :)
Want to guess how many characters the regex is?
md5sum 4fd94ffafd4499200f3dc8c7a46fba2e
 
"it" = unique characters?
 
This chat shows you what message a reply is replying to
it = the perfect powers puzzle
(Click the bent arrow on the left side of a message that's a reply to another message to see what it's replying to)
 
Ooh
 
So, want to guess how long it is? :)
 
Alright, too bad this doesn't give a separation between ECMA and ECMA+(?*)
Hmm, 300ish?
 
11:49 AM
Also, you of course meant distinct A and B. Otherwise every N={perfect power + 1} passes with the trivial A=B=N-1.
Nope, 771.
 
That's something
 
So I guess you heeded some of my spoiler warnings?
Because I discussed the technique to solve problems like this.
 
Did you? I don't remember that.
 
4
A: Is this a consecutive-prime/constant-exponent number?

DeadcodeRegex (ECMAScript), 276 bytes Comparing the multiplicities (exponents) of different prime factors is an interesting problem for solving with ECMAScript regex – the lack of backreferences that persist through iterations of a loop makes it a challenge to count anything. Even if counting the numeri...

 
Okay I never saw that
Interesting
 
11:53 AM
The thing is, you came close to something that'd be impossible.
The only reason I was able to solve this is the parity of the perfect power is the same as the parity of the base.
 
So, some variant of this could be impossible in pure ECMA?
 
Maybe.
 
One variant I considered is requiring the match to be of length B-A (which can be greater than N/2)
Would that defeat your technique?
 
No, all I have to do is put the whole thing in a lookahead, if I'm understanding you
Would you like to see the commented regex, or do you want to try the technique from scratch first (not necessarily on this particular problem)?
 
12:16 PM
Oh also, congratulations on finding a seemingly simple sequence that isn't on OEIS.
I'll bet they would add it.
 
(?s:(?=(?<a>.*))(?<b>X(?=\k<a>\z)|(?<=(?=$x|(?&b)).))) you guys fancy trying to break that, claimed to be a plug-n-play equivalent of (?<=X) (aside from the fact that it creates two capture groups)
I moved 'X' into the parent capture group in case it was zero-width, such as ^
 
:-O
 
Do your worst! :p
 
Why is it (?s)? What if the desired use case is non-/s?
 
(?s) makes it work in all cases
 
12:23 PM
just to simplify ".*" and "." at the end. Really, I shouldn't use that at all, in case the arbitrary subexpression 'X' relies on //s being disabled
 
also it's localized to within the parens, so it's not gonna break the rest of the pattern if that's non-s
Just needs (?-s:X)
But at this point it might be shorter to just use [\n\N]
 
I should've said, in case the arbitrary subexpression relies on //s being one way or the other :P
But yes, agreed, I'll go back to that mess
 
Actually \C would work fine here
It's not strictly equivalent to [\n\N], but it's guaranteed to yield a non-empty match any time [\n\N] would do so, which is enough
 
For the first occurrence? I seem to recall it failing to match under certain conditions
 
But it could go out of phase if there's any Unicode, right?
 
12:31 PM
Sure, but as long as X itself doesn't use \C, it'll properly resync
...I think
 
@Grimy Did you see my question? (regarding the no-(?*) technique)
 
Yeah, I'd be interested in seeing the full regex
 
Does ^\C*$ hold true for arbitrary strings in any environment? Because I could've sworn I've seen it fail.. but I might be confusing that with it throwing runtime errors when encountering stray surrogates
Did all this testing maybe 8 years ago
 
It should always hold true, yes, if my understanding of the docs is correct
 
I feel like I should leave it as (?=[\s\S]*) for demo purposes to avoid further complicating things
 
Yeah that sounds sensible
\54, yum
 
Mine's organized quite differently
 
This is the non-halved regex the halved one is based on: regex for matching perfect powers - alternative method.txt
@jaytea I guess it's impossible to capture anything inside this lookbehind that persists outside of it?
 
12:53 PM
Nah it's possible
Just gotta rewrite your regex in continuation passing style
 
By moving the "outside" stuff inside at the end of it in a lookahead, right?
 
Or in a recursion
 
Continuation passing? What's that?
 
Term from functional programming
Basically, never return, just keeps recursing deeper
 
Yeah.. so just re-write the whole expression so it works in tandem with the whole "go back one character at a time" framework
 
1:02 PM
I don't think you need to rewrite anything?
 
Still, it won't be able to return captures to the caller.
 
Yeah, the caller shouldn't do anything else after that
Instead do (?s:(?=(?<a>.*))(?<b>X(?=\k<a>\z)(?&continuation)|(?<=(?=$x|(?&b)).)))
And then (?<continuation>) can use the captures set in X
 
No, I mean the non-regex program that evaluated the regex.
 
Oh
Yeah, you'd need callouts for that
 
Oh, yes.
 
 
2 hours later…
3:07 PM
drregex.com/2019/02/variable-length-lookbehinds-actually.html I banged out a quick post about it :D Gotta head home right now, but I'll have to play with that damn explanation tomorrow because the tabs/lines are all screwed
God I hate HTML
 
 
2 hours later…
5:25 PM
@jaytea Title is incorrect
Actually possible in PCRE, not Perl afaik
This relies on propagating the value of backreferences inside recursions, which Perl doesn’t do
Or, as man pcrecompat puts it: Captured values that are set outside a subroutine call can be referenced from inside in PCRE, but not in Perl.
Other than that, great explanation, thanks for the write-up (=
 
 
2 hours later…
7:07 PM
@Grimy Have you thought about designing a problem that's actually impossible in ECMA but possible in ECMA+(?*)? The reason this one was possible is that dividing an odd by an odd yields an odd, and dividing an even by an even yields an even. When dividing in a loop, if the parity could change, that would probably make it impossible, because there's probably no way to communicate the new parity to the next iteration.
Or, force even more values to be squeezed together, requiring dividing by 3 or more, with a looped calculation in which the modulo-by-3-or-more can change.
 
Yeah, I thought about it, but of course proving something impossible is very hard
 
Yeah, but there's no need to go directly to proving it impossible. It'd be quite helpful towards further developments to have a problem that seems probably impossible.
 
What about perfect powers A, B, C such that (N - A) is a perfect power of (N - B), and (N - A) is coprime with (N - C)?
I don’t like that this is so hard to state, there should be a simpler probably-impossible problem
 
7:28 PM
@Grimy Can just put the already-developed regex in a lookahead, and for its matches, search for a C that is a perfect power (capturing C as half+remainder) and then do two separate loops to see if N-C has prime factors in common with N-A, one for primes that are 1 mod 4, and another for those that are 3 mod 4. (Or something like that - maybe 4 categories of primes if it turns out to be necessary).
Probably worth actually trying in case there's anything I didn't think of that'd make it impossible.
The problem from yesterday already yields by far the largest ratio of without-(?*) to with-(?*) size of anything I'd previously done :)
 

« first day (5 days earlier)      last day (1322 days later) »