Gollum@feddit.de to Programmer Humor@programming.dev · 1 year agoD or d come oni.imgur.comimagemessage-square218fedilinkarrow-up11.41Karrow-down147 cross-posted to: programmerhumor@lemmy.ml
arrow-up11.36Karrow-down1imageD or d come oni.imgur.comGollum@feddit.de to Programmer Humor@programming.dev · 1 year agomessage-square218fedilink cross-posted to: programmerhumor@lemmy.ml
minus-squareFeyter@programming.devMlinkfedilinkarrow-up2·1 year agodown matches down* because * also includes empty string. Also download matches down* D matches D* but d is not matching D* because D is a different character than d.
minus-squarelemmonade@lemm.eelinkfedilinkarrow-up1·1 year agobut why do we have to match specifically against substr*? it’s not a law of nature, we could also match against the regex (?i)substr(?-i).* not saying that one option is necessarily better, but I don’t see a good reason for which it any one of these options is terrible
down
matchesdown*
because*
also includes empty string. Alsodownload
matchesdown*
D
matchesD*
butd
is not matchingD*
becauseD
is a different character thand
.but why do we have to match specifically against
substr*
? it’s not a law of nature, we could also match against the regex(?i)substr(?-i).*
not saying that one option is necessarily better, but I don’t see a good reason for which it any one of these options is terrible