#spent way too long figuring out how regex.h (POSIX regex lib) worked only to discover that POSIX regex is like... not very good...
Explore tagged Tumblr posts
Text
the first rule of using pointers is have fun and be yourself
#been doing some definitly unsafe shit for advent of code#didnt want to do propper bounds checking today so my solution relies on the fact that the data is 140x140 and my matrix is 150x150#yesterday was a little odd aswell cause i was doing like pattern matching without regex#don't think my solution was super unsafe or anything but pointer arithmetic is not something ive done in the past really#tried re-writing it w/ regex (in C) but i discovered the hell that is different regex versions#spent way too long figuring out how regex.h (POSIX regex lib) worked only to discover that POSIX regex is like... not very good...#like posix regex doesnt even have non-capturing groups???#(and regex101.com doesnt support POSIX ere/bre)#ended up writing a pretry swanky solution w/ regex in python and someone in my school's AOC discord put it in a oneliner lol
0 notes