0

/ca|cb/ is same as /c[a|b]/.

But when I convert /.*\n|.*$/ to /.*[\n|$]/, the second Regexp doesn't match 'aaa' while the first does.

So how to make terminal symbol($) work in a character group([])?

djy
  • 737
  • 6
  • 14

0 Answers0