Thread overview | |||||
---|---|---|---|---|---|
|
April 25, 2012 Using input ranges with std.regex? | ||||
---|---|---|---|---|
| ||||
Does std.regex support input ranges to match()? Or do I need to convert
to string first?
Thanks!
T
--
Tell me and I forget. Teach me and I remember. Involve me and I understand. -- Benjamin Franklin
|
April 25, 2012 Re: Using input ranges with std.regex? | ||||
---|---|---|---|---|
| ||||
Posted in reply to H. S. Teoh | On 25.04.2012 23:08, H. S. Teoh wrote: > Does std.regex support input ranges to match()? Or do I need to convert > to string first? > For now, yes you have to convert them. Any random access range of code units should do the trick but stringish template constraints might kill that. I plan to extend this eventually. The problematic point is that match internally is delimited by integer offsets (indices). Forward ranges technically can work (the match then will return something like take(..., n);) with a bunch of extra .save calls. Input ranges can't be used at all. -- Dmitry Olshansky |
August 11, 2014 Re: Using input ranges with std.regex? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Dmitry Olshansky | On Wednesday, 25 April 2012 at 21:43:11 UTC, Dmitry Olshansky wrote:
> On 25.04.2012 23:08, H. S. Teoh wrote:
>> Does std.regex support input ranges to match()? Or do I need to convert
>> to string first?
>>
>
> For now, yes you have to convert them. Any random access range of code units should do the trick but stringish template constraints might kill that.
>
> I plan to extend this eventually. The problematic point is that match internally is delimited by integer offsets (indices). Forward ranges technically can work (the match then will return something like take(..., n);) with a bunch of extra .save calls. Input ranges can't be used at all.
Is there any progress on this thing?
|
Copyright © 1999-2021 by the D Language Foundation