[erlang-bugs] binary:matches/3 fails in R14A

Tuncer Ayaz <>
Fri Feb 1 18:32:13 CET 2013


On Fri, 01 Feb 2013 15:37:46 +0100, Patrik Nyblom wrote:

> Hi Tuncer!
> On 01/31/2013 09:33 PM, Tuncer Ayaz wrote:
>> Originally reported by Bartosz Kolodziej as part of [1]
>> is the following a bug or intentionally throwing badarg?
> As the option 'global' is not valid for binary:matches (only for
> replace and split), it's most definitely intentional.
> binary:matches, btw, already searches for all matches.

Yeah, I realized that thanks to Fred [3].

Still, would it make sense to support 'global' in binary:match/N and
make it thereby function like binary:matches/N?

[3] http://erlang.org/pipermail/erlang-bugs/2013-January/003343.html

> I however strongly discourage use of R14A, it's a release candidate...

I'm not using that release, it's just the version Bartosz tested with
in 2010.

>> 1> binary:matches(<<>>,<<"a">>,[global]).
>> ** exception error: bad argument
>>       in function  binary:matches/3
>>          called as binary:matches(<<>>,<<"a">>,[global])
>>
>> Tested with otp.git at 68b804f.
>>
>> [1] http://erlang.org/pipermail/erlang-bugs/2010-August/001967.html
>> [2] http://erlang.org/pipermail/erlang-bugs/2011-December/002693.html


More information about the erlang-bugs mailing list