in reply to Collapsing repetitive equality tests: || vs {} vs // (an observation)

Almost the same. The regex will also return true for "A\n", "B\n", or "C\n". Try using \z instead of $.
  • Comment on Re: Collapsing repetitive equality tests: || vs {} vs // (an observation)