in reply to Mnemonic for begin/end chars in regexes

I thought of something like this:

I begin reading at the top of a page, so I see ^ pointing to the beginning of the text on a page, or here to the beginning of the string.

Currently I don't have a similar picture for the $ at the end. But this decision is a 50/50 chance, so if I can memorize the ^ for the beginning, the other must be for the end.

  • Comment on Re: Mnemonic for begin/end chars in regexes

Replies are listed 'Best First'.
Re^2: Mnemonic for begin/end chars in regexes
by ibm1620 (Hermit) on May 12, 2023 at 21:32 UTC
    I think of '^' as indicating "the top", and '$' as the "bottom line".