[erlang-questions] re2

Led ledest@REDACTED
Thu Aug 2 02:30:36 CEST 2018


2018-08-01 20:53 GMT+03:00 Анна Мухаррам <amuhar3@REDACTED>:

> Hello everyone!
>
> With use of *re* library it is possible to get all words in string with
> command:
>
>   re:run("word1, word2 ,word3", "[a-z0-9]+", [global, {capture, all,
>> binary}]).
>>   {match,[[<<"word1">>],[<<"word2">>],[<<"word3">>]]}
>>
>
>  But *re2* doesn't have *global* option. So with *re2* I get:
>
> re2:run("word1, word2 ,word3", "[a-z0-9]+", [{capture, all,
>> binary}]).
>> {match,[<<"word1">>]}
>>
>
> How could I find all words in string with *re2*?
>
> Thank you!
>
>
 [{offset, Offset}, {capture, all, index}] with recursion.

But... Why???

-- 
Led.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180802/a068034b/attachment.htm>


More information about the erlang-questions mailing list