Post AHeXgOhDDLkCv5hP3A by Johann150@fosstodon.org
(DIR) More posts by Johann150@fosstodon.org
(DIR) Post #AHeVQPElEd4m3YddFw by phryk@mastodon.social
2022-03-21T23:07:37Z
1 likes, 2 repeats
Consider thyself documented, regexp!
(DIR) Post #AHeX2ZNK5dnYSQP9lY by lanodan@queer.hacktivis.me
2022-03-21T23:27:05.337298Z
0 likes, 0 repeats
@phryk Eeeh…You know that most languages allow to concat regexes like a string natively, right?Otherwise just split the regex into some smaller chunks combined via if/else, which often allows to entirely avoid the confusing parts by using normal statements instead.
(DIR) Post #AHeXgOhDDLkCv5hP3A by Johann150@fosstodon.org
2022-03-21T23:34:19Z
0 likes, 0 repeats
@phryk @phryk those comments dont seem to be quite correct: 2nd item is not optional, its the same as line 5th item. 3rd item is not optional, `(?:blah)` is just a non-capturing group but its still required to match. the 8th item is documented correctly but does not make sense, why would you match at least one non-space character and then ANY CHARACTERS arbirtrarily (but as few as possible) 😖
(DIR) Post #AHeZ8XKQoPPLkv1czQ by phryk@mastodon.social
2022-03-21T23:50:37Z
0 likes, 0 repeats
@Johann150 Thanks for pointing those out.This is (save for a fix for C-style multi-line comments) a regexp I inherited and I'm already more than glad that I finally understood the damn thing. 😅 The last point made me wonder, too. I already told my boss (initial developer behind this) that I'll want to clear up some questions about his regexps during review. :P