Post

What are you using instead? Writing your own Knuth–Morris–Pratt implementation? That would be sick to show in a tech interview :D "Nah I don't like regexes, I dont bytewise comparisons with my own algorithms" (throw in some big-O terms after that) "btw did you know regex lookbehind is O(2^n)?"

lol ya i like writing parsers but there are also so many options that all depend entirely on the use case. tons of common parsing work has been done and tested rigorously, and regex is so fickle

You can make them not fickle but I agree crazy regexes with cryptic stuff and lookahead/behind should be banned. A lot of programming languages do not allow them anyway with their standard implementation. And you dont need regex for basic string matching.

(I have no idea if it's O(2^n) don't quote me on this (they don't know either though (probably))

right, i mean maybe i was working with regex when i made the post and was expressing my current frustration, but i'm sure your assumption was good too.

But they so simple, what could go wrong? ^(?:https?:\/\/)?(?:www\.)?([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})(?:\/[^\s]*)?(?:\?([a-zA-Z0-9_]+=[^&]*&?)*)?(?:#([a-zA-Z0-9_-]+))?$