Your mama so fat
She can’t store files greater than 4GBMy mama was fat, but now she is exfat
All human strings are finite…
Pumping lemma enters the chat.
Removed by mod
Famously true: https://youtu.be/5iln6fkwJOU
You clods won’t shut up about regular expressions.
What should we talk about then, glob patterns (which are NOT regular expressions, for the love of all that is holy and unholy, stop calling glob patterns RE!)
Historically, pattern matching notation is related to, but slightly different from, the regular expression notation
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_13
Also matches TakesOutzTheYourMother, since the asterisk allows for zero matches to the group, and there seems no bounding constraints:-).
Keep in mind that in OG regex, period is used to concat.
I strongly hesitated saying anything at all b/c there are so very many different rules governing the behavior of every single kind of symbol. Though one jumping off point is the use of the parenthesis, without slashes prior to them and them meaning alternatives within a grouping context rather than merely “remembering”, for the sake of e.g. replacement or copying, so e.g. in the Unix CLI “grep” command this would not work even with the -e parameter (I am not so sure about perl-style though, or rather, this would work within pure perl, but perl-style regexps from within grep is another matter, plus that option itself is not universal across all forms of Unix).
In any case, I hoped that the YoMama joke would be universally understood and appreciated regardless, across all of the many & varied language barriers 😜.
True, but see, all these build up on the theoretical regex. The theoretical regex indeed has only 3 operators: dot for concatenation, pipe for alteration and the ‘kleene star’ [re: Sipser’s]. These 3 operators can express a finite state automata. You don’t really need all that other operators. Read this: https://swtch.com/~rsc/regexp/regexp1.html Algorithms like Thompson construction can translate a regex to a non-deterministic automata quite quickly, and then from there you can make a DFA or just simulate the NFA.
I would not call PCRE ‘regular expression’ really. If you read the article I gave you it explains why they are mostly a practical utility than a theoretical groundwork. The regex in use today is far from the regex one learns about in books.
I think regex is abused. People use it to parse context-free grammars. Extremely intricate and feature-rich patterns cause people to make mistakes, and end up with security holes!
That being said, I really enjoy NeoVim’s regex. I also like Perl’s. But I would not rely on them for parsing, or even lexing.