[flagged]
I clicked this link because the question is interesting. Yes the answer won't change my life, or even make me more money, but it got me curious. That's why I don't think your response is helpful or insightful.
Why do regexes use `$` and `^` as line anchors?
11–19 of 19 posts
Re: Why do regexes use `$` and `^` as line anchors?
#12Re: Why do regexes use `$` and `^` as line anchors?
#13They're because that's what Bill Joy used in vi back in 1979 to move to the beginning and end of a line. It made sense to use them for regex too.
Re: Why do regexes use `$` and `^` as line anchors?
#14Not sure about $ sign, but ^ probably comes from ADM-3A: https://en.wikipedia.org/wiki/ADM-3A#Legacy And here is a photo of its keyboard: https://twitter.com/toresbe/status/1756800589340549609/photo...
Re: Why do regexes use `$` and `^` as line anchors?
#15Re: Why do regexes use `$` and `^` as line anchors?
#16That’s not an explanation, it’s speculation. The whole article was guess work and you picked something that sounded plausible. Ken Thompson is alive, why not ask and confirm? Then you could say you have an explanation.
Re: Why do regexes use `$` and `^` as line anchors?
#17> So there you have it, an explanation for the regex anchors that kinda makes sense. That’s not an explanation, it’s speculation . The whole article was guess work and you picked something that sounded plausible. Ken Thompson is alive, why not ask and confirm? Then you could say you have an explanation.
Re: Why do regexes use `$` and `^` as line anchors?
#18> So there you have it, an explanation for the regex anchors that kinda makes sense. That’s not an explanation, it’s speculation . The whole article was guess work and you picked something that sounded plausible. Ken Thompson is alive, why not ask and confirm? Then you could say you have an explanation.
Explanations and speculation: are they mutually exclusive? I'd say an answer from Ken Thompson would be a definitive explanation that might disprove the author's explanation, but that doesn't mean it's not an explanation.
Re: Why do regexes use `$` and `^` as line anchors?
#19> So there you have it, an explanation for the regex anchors that kinda makes sense. That’s not an explanation, it’s speculation . The whole article was guess work and you picked something that sounded plausible. Ken Thompson is alive, why not ask and confirm? Then you could say you have an explanation.
Explanations and speculation: are they mutually exclusive? I'd say an answer from Ken Thompson would be a definitive explanation that might disprove the author's explanation, but that doesn't mean it's not an explanation.
Yes. You only need to speculate when you don’t have a firm explanation.
> disprove the author's explanation
Speculation is “the forming of a theory or conjecture without firm evidence”, which is what the author is doing. They’re not explaining, they’re guessing at a reason.