Proof that Regex is Hate Speech!
Proof that Regex is Hate Speech!
Proof that Regex is Hate Speech!
I still don't understand regex at all
I recommend using https://regex101.com/
It explains all parts of your regex and highlights all matches in your example text. I usually add a comment to a regex101 playground if I use a regex in code.
The plural of regex is regrets.
My guess is, that someone started with a small share of features to find a simple solution for the problem, but the complexity of the problem got waaaay out of hand.
Regexes are actually used in formal computer science (if that's the right term), i.e. "proof that this and that algorithm won't deadlock" or something like that.
They're actually really elegant and can cover a lot. But you'll have to learn them by using them.
Regex is actually just a way to write (Epsilon) non determistic state automata(ε-NDA) using text! ε-NDA comes from automata theory and they are just a somewhat powerful way to describe state machines! They can kind of be seen as a stepping stone to things like Context-Free Grammars which is what language parsers use to define their language/parsers, and Turing machines! Regex is a fundamental part of computer science, and they are of course incredibly useful in string validation due to their expressive power! If you study at uni and get the chance to take a course in automata theory I recommend it! Personal favorite subject :)
It's really not too bad as long as:
People write regex in notepad and complain it doesn't work on the first try...
It's pattern-matching. Like searching *.txt
to get all text files. It's just... more. There's symbols for matching the start of a string, the end of a string, a set of characters, repetition, etc. Very "etc." And the syntax blows. The choices of .
for match-any-character and *
for zero-or-more really fuck with common expectations.
It can also replace substrings that match. Like changing the file extension of all text files. Where it gets properly difficult is in "capture groups." Like looking for all file extensions, and sticking a tilde after the dot. You can put parentheses around part of the pattern being matched and then reference that in the replacement. Conceptually simple - pain in the ass to use properly - syntax both sucks and blows.
Lookahead is what you do to match "ass" but not "assault." I refuse to elaborate further.
//////?-.,", duh,?!
Nobody does.
Error in Moderation
Could have been worse. Could have been an Error in Excess.
Regex's are not something you need AI for as there are already tools that explain them for you. Use regexr.com or a similar tool.
Regex's
Foxes
Boxes
Hexes
Regexes
You can do it. You too can pluralize without an apostrophe.
Oxen
Children
Brethren
Regexen
I've begun to understand that the modern meaning of an apostrophe is "oh shit! Here comes an 's'".
Sadly, I am gradually growing okay with that idea.
Thanks for pointing that out, it's a bad habit I've picked up!
____ are not something you need AI for as there are already tools that explain ____ for you. Use Wikipedia or a similar tool.
I don't agree that AI has no uses, you just have to know when to use it. There are multiple times I have scoured documentation and official forums of a niche tool to few results only to ask ChatGPT and get far closer to my goal in 2 minutes than I did in 30. I know the AI has to be getting that info from somewhere, but if Google, Reddit, and a forum search can't find it then I am sorry but I am going to ask an AI.
Yeha, also anything else has plenty of books and internet content on them so you really don't need AI for those too.
Groups multiple tokens together and creates a capture group for extracting a substring or using a backreference
With an explanation like this, I thing I'll take the AI.
You have a problem. You decide to use regex to solve it. Now you have two problems.
I got the “error in moderation” today today too when I asked it to make me a ghost with the beard and body type of Santa Claus. Like it knows Santa is not a real person right?
Ya, it's a generic error from the looks of it. Didn't know what error to throw when it went down, so it appears to have defaulted to this.
This is proof that regex even confuses the bots.
May be our own path to survive the AI rebellion.
Maybe the goal wasn’t to stop the AIs but the aaaaaaaaaaaaaaaaaaaaaaaa! we made along the way.
(For reference: https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)