April 14, 2017 Regex multiple matches | ||||
---|---|---|---|---|
| ||||
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. |
April 14, 2017 Re: Regex multiple matches | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jethro | 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.
|
Copyright © 1999-2021 by the D Language Foundation