« first day (1287 days earlier)      last day (2505 days later) » 

1:24 AM
Really final and fixed version (lol) regex101.com/r/yD1kL7/17
 
 
1 hour later…
2:36 AM
@bwoebi This reinforce that regex is a write only language
 
I find it much easier to read than to write though
I mean… I've needed like a 10 hours
@nhahtdh … if you need 10 hours to understand it, then it's probably only because you've never used regex…
so not quite write-only
 
@bwoebi: Not when you want to check whether your regex is correct
 
for ($i = 0; $i < $n; $i++) {
        for ($j = 0; $j < $n; $j++) {
                for ($k = 0; $k < $n; $k++) {
                        if (preg_match($r, $e = decbin($i)." + ".decbin($j)." = ".decbin($k)) != ($i + $j == $k)) {
                                die("$e\n");
                        }
                }
        }
}
That's trivial though…
@nhahtdh If you want to manually verify correctness… well… forget it…
 
I'm talking about something like static analysis
You look at the code, and you can tell that it only does what it's supposed to do, and nothing else
All paths are explored
 
@nhahtdh Once a regex is not just matching type-3 chomsky languages you very quickly become unable to verify it…
Perhaps you can transform it into a grammar, but that transformation is typically not trivial
 
2:44 AM
I'm not trying to do it for all cases. Just enough for the problem I'm solving, and not really an attempt to automate it
 
well… PCRE feels a lot like programming a turing machine… iterate to end, then backward to add a single element to group, then backtrack and move one character forward…
It's just like you'd want to debug a turning machine with a hundred of interconnected states…
 
3:04 AM
I give up trying to analyze it
Time to go back on my work
 
@nhahtdh wow, were the comments not helpful?
 
3:32 AM
@bwoebi It provide some general idea, which is great, but I still need to follow the execution of the regex, which is not something I can afford right now
 
@nhahtdh yeah, I'm eventually going to write it up as self-answered question on SO with more detail… I'll ping you then (will be Saturday probably)
 
Just paste the link into this room
No need to ping
 
fine
 
 
19 hours later…

« first day (1287 days earlier)      last day (2505 days later) »