Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "im serious by the way"
-
API Guy.
He has a serious regex problem.
Regexes are never easy to read, but the ones he uses just take the cake. They're either blatantly wrong, or totally over-engineered garbage that somehow still lacks basic functionality. I think "garbage" here is a little too nice, since you can tell what garbage actually is/was without studying it for five minutes.
In lieu of an actual rant (mostly because I'm overworked), I'll just leave a few samples here. I recommend readying some bleach before you continue reading.
Not a valid url name regex:
VALID_URL_NAME_REGEX = /\A[\w\-]+\Z/
Semi-decent email regex: (by far the best of the four)
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
Over-engineered mess that only works for (most) US numbers:
VALID_PHONE_REGEX = /1?\s*\W?\s*([2-9][0-8][0-9])\s*\W?\s*([2-9][0-9]{2})\s*\W?\s*([0-9]{4})(\se?x?t?(\d*))?/
and for the grand finale:
ZIP_CODE_REGEX = /(^\d{5}(-\d{4})?$)|(^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$)|GIR[ ]?0AA|((AB|AL|B|BA|BB|BD|BH|BL|BN|BR|BS|BT|CA|CB|CF|CH|CM|CO|CR|CT|CV|CW|DA|DD|DE|DG|DH|DL|DN|DT|DY|E|EC|EH|EN|EX|FK|FY|G|GL|GY|GU|HA|HD|HG|HP|HR|HS|HU|HX|IG|IM|IP|IV|JE|KA|KT|KW|KY|L|LA|LD|LE|LL|LN|LS|LU|M|ME|MK|ML|N|NE|NG|NN|NP|NR|NW|OL|OX|PA|PE|PH|PL|PO|PR|RG|RH|RM|S|SA|SE|SG|SK|SL|SM|SN|SO|SP|SR|SS|ST|SW|SY|TA|TD|TF|TN|TQ|TR|TS|TW|UB|W|WA|WC|WD|WF|WN|WR|WS|WV|YO|ZE)(\d[\dA-Z]?[ ]?\d[ABD-HJLN-UW-Z]{2}))|BFPO[ ]?\d{1,4}/
^ which, by the way, doesn't match e.g. Australian zip codes. That cost us quite a few sales. And yes, that is 512 characters long.47 -
My boss and one of my coworkers “touch me”...
I’m usually one of the first ones in the office. When my coworker comes in and walks by, he touches my shoulder from the back in a “hello friend” kinda way.
Especially when I’m trying to ignore him he pokes my shoulder. He could you’d waved his hand in front of my head.
My boss is trying to be the “buddy” I guess. When having lunch and someone says something funny, he literally rests his hand on my shoulder or kinda rams my shoulder with his shoulder..
They think that’s nice and “bonding” but I hate it and it makes me very very uncomfortable. The ONLY ones who are allowed to touch me are my GF (I don’t have one) and other girls i know in a night out after a few drinks.
Not even my best friends touch me cause they know I don’t like that.
Im giving obvious signs that they should stop but they don’t get it..
On the other hand I probably have some serious problems that It makes me that uncomfortable in the first place, but not sure how to fix that.. i don’t even go to the barber shop because they have to touch me to cut my hair. So I cut them myself or my dad does it once in a year.17 -
Here's an idea: starting my own botfarm to automatically downvote obnoxious adbots that simply won't stop tickling our collective fucking testicle sax with unrequited love stories and crypto bullshit.
To detect the sheeit, just look for idiot giving contact info in a rant about hacking the device of your unfaithful spouse/treacherous cyber girlfriend who also ran a bitcoin scam and fucked you in the ass with a welding torch. That should do the trick, I can give you that power with a perl script, because fuck you that's why.
But since there is no moderation in this bitch, daring to offer me sufficient knowledge to the inner workings of such a construct would be exceptionally perilous to your asshole. That is to say, nothing could then stop me from redirecting said botfarm to target my enemies and anally assault their every rant and comment.
Indubitably, this would in turn quickly spiral into digital warfare of cyberfeudal lords pitting their automated fake accounts against each other. Millions will die. Upside being hexical gets to pull the plug without guilt.
What do you say? Should we begin the apocalypse?19