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

27 views
Skip to first unread message

Max Lapshin

unread,
Nov 16, 2012, 5:27:42 AM11/16/12
to Erlang-Questions Questions
Hi.

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.

Reply all
Reply to author
Forward
0 new messages