Sep 3, 2019 05:32
Just checking back in to say hey guys :) The last few months have been a blur: planned a wedding, got married, had a honeymoon - whew! It's great to see there's still some activity on the regex front. I'm hoping to rekindle the old flame and start participating in challenges, updating my blog, and finally completing the quiz I've had in the works for a long ass time
Mar 26, 2019 05:07
What an awesome display of resourcefulness :P
Mar 25, 2019 04:56
Grimy is brilliant and I wouldn't put it past him to have discovered it independently.. but what a cool coincidence. And you discovered it in response to the very same challenge (find a unique character) if I'm not mistaken?
Mar 25, 2019 04:55
I just got your e-mail and was about to post that here
Mar 25, 2019 04:55
Hauke :D
Feb 24, 2019 13:58
debtsm.art/rgx-english.html this is hilarious
Feb 17, 2019 05:48
Oh, of course. Didn't even think that it might be considering it a variable name in the middle of a pattern like that
Feb 14, 2019 08:38
Looks like Perl is doing something with "$x". Maybe some sort of optimization. Very puzzling. "x^" is fine though, so the expression can be touted for both Perl/PCRE now with that :)
Feb 14, 2019 08:33
I mean (?=(?'a'[\s\S]*))(?'b'X(?=\k'a'\z)|(?<=(?=(?&b)).))
Feb 14, 2019 08:33
er
Feb 14, 2019 08:33
Wait, the opposite, Perl doesn't need those: (?=(?'a'[\s\S]*))(?'b'X(?=\k'a'\z)|(?<=(?=$x|(?&b)).)) works fine haha
Feb 14, 2019 08:30
Found it :P I think "$x" isn't good enough of a non-empty contradiction for Perl
Feb 14, 2019 08:13
(?1) isn't matching empty there, at least
Feb 14, 2019 08:12
[12:12:30] <+jaytea> !eval ["abc" =~ /(\w)(?<=(?=(?1)c))/]
[12:12:34] <+perlbot> ["a"]
[12:12:41] <+jaytea> !eval ["abc" =~ /(\w)(?<=(?=(?1)b))/]
[12:12:45] <+perlbot> []
Feb 14, 2019 08:11
The result implies "(?&b)" matches an empty string, so (?<=(?=$x|)[\s\S]) matches at the first opportunity, just after "b"
Feb 14, 2019 08:08
the result contains the value of \1 and \2 (a and b)
Feb 14, 2019 08:08
[11:22:33] <+jaytea> !eval ["blaXhiiiiiiii" =~ /(?=(?'a'[\s\S]*))(?'b'X(?=\k'a'\z)|(?<=(?=$x|(?&b))[\s\S]))(.+)/]
[11:22:36] <+perlbot> ["laXhiiiiiiii","","laXhiiiiiiii"]
Feb 14, 2019 08:08
Also, I'm getting a very puzzling result from this perl bot on IRC (running v 5.24)
Feb 14, 2019 08:07
Yay
Feb 14, 2019 07:33
But that appears to have changed in 5.20
Feb 14, 2019 07:33
Grimy, has that changed? Just quickly trying to find info about that, and I see on regular-expressions.info/recursecapture.html it says "When Perl 5.10 [through to 5.18]'s regex engine enters recursion, all capturing groups appear as they have not participated in the match yet."
Feb 13, 2019 15:07
God I hate HTML
Feb 13, 2019 15:07
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
Feb 13, 2019 12:59
Yeah.. so just re-write the whole expression so it works in tandem with the whole "go back one character at a time" framework
Feb 13, 2019 12:35
I feel like I should leave it as (?=[\s\S]*) for demo purposes to avoid further complicating things
Feb 13, 2019 12:34
Did all this testing maybe 8 years ago
Feb 13, 2019 12:34
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
Feb 13, 2019 12:30
For the first occurrence? I seem to recall it failing to match under certain conditions
Feb 13, 2019 12:25
But yes, agreed, I'll go back to that mess
Feb 13, 2019 12:25
I should've said, in case the arbitrary subexpression relies on //s being one way or the other :P
Feb 13, 2019 12:23
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
Feb 13, 2019 12:21
Do your worst! :p
Feb 13, 2019 12:20
I moved 'X' into the parent capture group in case it was zero-width, such as ^
Feb 13, 2019 12:19
(?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)
Feb 13, 2019 08:23
Any personal webpage or anything you want linked?
Feb 13, 2019 08:22
@Grimy, how would one introduce you? :p
Feb 13, 2019 08:22
Yeah
Feb 13, 2019 08:17
By all means post about it on SO :P Let's get the word out!
Feb 13, 2019 08:16
Ah but "$x" fails regardless of the set status of (?m)
Feb 13, 2019 08:04
Haha. Mime it
Feb 13, 2019 08:04
how the devil are you
Feb 13, 2019 07:57
hey David :P
Feb 13, 2019 07:57
Golf addict!
Feb 13, 2019 07:43
no matter how you cut it, it's going to look a little "wtf" at first glance :p
Feb 13, 2019 07:42
And $x should be a contradiction in all contexts, if I'm not mistaken. in place of [^\s\S]
Feb 13, 2019 07:42
Good idea!
Feb 13, 2019 07:01
@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!
Feb 13, 2019 06:59
Fun new toy haha
Feb 13, 2019 06:59
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]).)))
Feb 13, 2019 06:09
(oh, that should be [\s\S]* at the start there*)