Why is this expression not matching?<br><br>A = <<"ABC">>,<br>Empty = <<>>,<br><<Empty/binary, Tail/binary>> = A.<br><br>I was expecting that this would result in 'Tail' being bound to <<"ABC">>, but instead I'm getting a badmatch error. However, if I specify the length of the 'Empty' variable, it works:
<br><br><<Empty:0/binary, Tail/binary>> = A.<br>
<br>And if I put 'Empty' as the last part of the pattern it also works:<br><br><<Head/binary, Empty/binary>> = A.<br>

<br>Is matching for binaries supposed to work like this or is it a bug?<br><br>