owenfromcanada ,
@owenfromcanada@lemmy.world avatar

Your mama so fat
She can't store files greater than 4GB

xlash123 ,
@xlash123@sh.itjust.works avatar

My mama was fat, but now she is exfat

OpenStars ,
@OpenStars@startrek.website avatar

Also matches TakesOutzTheYourMother, since the asterisk allows for zero matches to the group, and there seems no bounding constraints:-).

ChubakPDP11 OP ,

Keep in mind that in OG regex, period is used to concat.

OpenStars ,
@OpenStars@startrek.website avatar

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 😜.

ChubakPDP11 OP ,

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.

JoYo ,
@JoYo@lemmy.ml avatar

You clods won't shut up about regular expressions.

ChubakPDP11 OP ,

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!)

LemoineFairclough ,

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

zea_64 ,

All human strings are finite...

devfuuu ,

Pumping lemma enters the chat.

ChubakPDP11 OP , (edited )

[Thread, post or comment was deleted by the moderator]

  • Loading...
  • xmunk ,
  • All
  • Subscribed
  • Moderated
  • Favorites
  • programmer_humor@programming.dev
  • kamenrider
  • Rutgers
  • loren
  • Lexington
  • cragsand
  • mead
  • RetroGamingNetwork
  • mauerstrassenwetten
  • MidnightClan
  • xyz
  • PowerRangers
  • AnarchoCapitalism
  • WatchParties
  • itdept
  • khanate
  • neondivide
  • AgeRegression
  • Teensy
  • WarhammerFantasy
  • space_engine
  • learnviet
  • bjj
  • supersentai
  • steinbach
  • electropalaeography
  • jeremy
  • Mordhau
  • fandic
  • All magazines