Today, this question can hardly be answered, because regular expressions were introduced more than fifty years ago. I can share the versions that seem most reasonable to me.
The dollar sign symbolized the end of the line back in ed. The first practical implementation of RE was introduced specifically in ed and derivatives (e.g., QED). And the dollar sign has been reused. This meant either the end of the line or the last line, depending on the context. This is more or less clear, but the question of why the dollar sign was originally designated as the end of something else remains. It ('$') is represented by the “ASCII approximation” of the typographic sign “end of paragraph”.
As for “^” as the beginning of the line, it is probably the “ASCII approximation” of the Greek letter lambda, which meant an empty expression in early theoretical works: http://www.fing.edu.uy/inco/cursos/intropln/material/ p419-thompson.pdf
source share