/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([]
)?
/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([]
)?