sometimes you see a piece of code so beautiful you simply must commit it to physical media in the most elegant way you know

(source, context)

#calligraphy

Putting aside the sheer absurdity of a multibillion-dollar machine learning company using regex to do sentiment analysis, an actual legit application for machine learning, it is so fantastically inefficiently written. Every time I wrote this out (like 2½ times) I see something new and horrible, and I'm not even what you'd call a regex wizard. Like, why wtf|wth and not wt(f|h)? Why are "horrible" and "awful" in there twice? Why fuck you|screw (this|you) and not (screw|fuck) (this|(yo)?u) ((bull)?shit|crap)? But there is no use trying to understand it because there is no thought or intention behind it. Simply a mindless word generator that got tossed at a problem again and again until the droppings accreted into something that worked well enough.

edit: AND ANOTHER THING, why not have, like, a case-insensitive flag or something rather than converting it to lower case?

@nev Because it’s for weighting not logic
@nev or in this case, creating by weighting not logic