digitalmars.D.learn - Regex multiple matches
-
Jethro
(5/5)
Apr 13 2017
using the rule (?P
regex) - rikki cattermole (7/12) Apr 13 2017 Pseudo code:
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.
Apr 13 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.
Apr 13 2017