Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the start of a line "^" and the end of line "$"?

I never remember whether ^ matches the beginning of the line and $ matches the end of it or the other way around. A good mnemonic would be that the $ sign is always before the price, therefore it matches the beginning of a line - unfortunately it's the other way around.

So is there any reason why these two characters were chosen for the beginning and end of line?

like image 470
laurent Avatar asked Sep 03 '12 14:09

laurent


1 Answers

One mnemonic: In an auction, bidders start by raising ^ their paddles. The price $ is established at the end.

like image 123
Blue Magister Avatar answered Oct 27 '22 18:10

Blue Magister