Get the latest tech news
Why do regexes use `$` and `^` as line anchors? (2024)
A history that will satisfy nobody.
Last week I fell into a bit of a rabbit hole: why do regular expressions use$ and^ as line anchors? This talk brings up that they first appeared in Ken Thompson's port of the QED text editor. QED was the precursor to ed, which was instrumental in popularizing regexes, so a lot of its design choices stuck.
Or read this on Hacker News