Skip to content

Comment on Why do regexes use `$` and `^` as line anchors?

Comments

They'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.

Per the article, these anchors appear in Ken Thompson's port of the QED text editor, which dates back to 1970.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.