Regex multiple matches

rikki cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 13 22:44:28 PDT 2017


On 14/04/2017 3:54 AM, Jethro wrote:
> using the rule (?P<name>regex)
>
> e.g., (?P<names>\w*)*
>
> how do we get at all the matches, e.g., Joe Bob Buddy?
>
> When I access the results captures they are are not arrays and I only
> ever get the first match even when I'm using matchAll.

Pseudo code:

foreach(result; matcher) {
	...
}

It returns an input range that can "act" as an array without the lookup 
by index, it is a very powerful abstraction.


More information about the Digitalmars-d-learn mailing list