[erlang-questions] Binary matching: <<String/binary, 0>> and <<Prefix/binary, Postfix/binary>>

Max Lapshin max.lapshin@REDACTED
Fri Nov 16 11:27:42 CET 2012


There are two forms of matching binaries, that are not supported:

extract_string(<<String/binary, 0>>) -> String.

extract_postfix(<<Prefix/binary, Postfix/binary>>, Prefix) -> Postfix.

Second one is perhaps too hard to implement, but first one seems to be not
to hard (we just match end of binary on known offset and match beginning).

Why aren't these cases implemented? Is it just "nobody wanted it yet" or
there is some serious reason not to do it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20121116/61ee2548/attachment.htm>

More information about the erlang-questions mailing list