regexmnemonics

Mnemonic tip for regex start of string/end of string metacharacters


It is well known that regular expressions are powerful. But it is also known that the syntax is a bit awkward.

For example, each time I use them, I find asking myself which of ^ and $ is the start of string (respectively end of string) metacharacter.

I know that a quick google search or a simple cheat sheet may answer this, but yet I wonder if anyone knows a good mnemonic tip.


Solution

  • This is what I can come up with: Starts small ends big.