Re: Is std.regex.match completely broken?

2011-03-01 Thread Jacob Carlborg
On 2011-03-01 14:03, Dmitry Olshansky wrote: On 28.02.2011 22:37, Jacob Carlborg wrote: The following code will result in an AssertError or RangeError when run. import std.regex; import std.stdio; void main () { auto m = "abc".match(`a(\w)b`); writeln(m.hit); // AssertError in regex.d:1795 wr

Re: Is std.regex.match completely broken?

2011-03-01 Thread Dmitry Olshansky
On 28.02.2011 22:37, Jacob Carlborg wrote: The following code will result in an AssertError or RangeError when run. import std.regex; import std.stdio; void main () { auto m = "abc".match(`a(\w)b`); writeln(m.hit); // AssertError in regex.d:1795 writeln(m.captures); // RangeError i

Is std.regex.match completely broken?

2011-02-28 Thread Jacob Carlborg
The following code will result in an AssertError or RangeError when run. import std.regex; import std.stdio; void main () { auto m = "abc".match(`a(\w)b`); writeln(m.hit); // AssertError in regex.d:1795 writeln(m.captures); // RangeError in regex.d:1719 } Should I report this as a

std.regex.match

2010-08-09 Thread bearophile
A question about std.regex.match() design. I am not sure, so I ask here first (if the ideas are sane I will write an enhancement request later). This is the current syntax you have to use to iterated on the matches: foreach (m; match(text, regex(r"\d")).captures) {} The regex() there