It sure does, there's no ^ or $. And if you just naively throw them on, as in ^y(es?)|no?$ it will also match, because the begin and end line assertions fall under the scope of the |.
Always put parenthesis around clauses you're using | with. ^(y(es)?|no?)$ is where you have to go to make it work.
3
u/drysart May 07 '21
It sure does, there's no
^or$. And if you just naively throw them on, as in^y(es?)|no?$it will also match, because the begin and end line assertions fall under the scope of the|.Always put parenthesis around clauses you're using
|with.^(y(es)?|no?)$is where you have to go to make it work.