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
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
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
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