Sammy Arson Fox ( arson )@theresnotime@fox.nexus

Thoughts on some (work) blog post titles pls

  • An engineer's retrospective on {project name}
  • An engineer’s retrospective on "understanding the assignment"
  • A deep-dive into the development of {project name}
  • A deep-dive into a difficult project
  • A deep-dive into the development of a difficult project

불러오는 중…

Tynach@Tynach@meow.social
@theresnotime@fox.nexus 님에게 답글

@theresnotime There are FAR scarier regular expressions out there. Like the one I wrote when I was first learning how to write them.. I was having a VERY hard time understanding the syntax, but I knew roughly what they could/couldn't do..

And eventually I gave up and, as a bit of a joke, picked the most horribly complicated standard I could think of/find and decided to try to write a regex for that. I knew I wouldn't succeed, and it wasn't important for it to actually work, so I figured it'd just be a bit of absurd fun.

I, uh.. I succeeded... And it burned how to write regexes into my brain.

Behold:

#^([a-z0-9+\-.]+):([/]{0,2}([a-z0-9\-._~%!\$&'\(\)\*+,;=:]+@)?([\[\]a-z0-9\-._~%!\$&'\(\)\*+,;=:]+(:[0-9]+)?))([a-z0-9\-._~%!\$&'\(\)\*+,;=:@/]*)(\?[\?/a-z0-9\-._~%!\$&'\(\)\*+,;=:@]+)?(\#[a-z0-9\-._~%!\$&'\(\)\*+,;=:@/\?]+)?#i

I expected to use forward slashes more often than I actually ended up needing to, so I used hashes as the delimiters instead. That relies on PCRE being used.

I also made the same mistake as I see in that IPA regex. That is, a lot of things that are consecutive Unicode control points aren't shown as a range in the regex.

I could have simplified that monstrosity of a regex I wrote by using ranges for more than just a-z and 0-9, but I didn't.. And the regex you screenshotted could be similarly optimized.