Re: regex matching but not capturing

2023-04-06 Thread Ali Çehreli via Digitalmars-d-learn
On 4/6/23 11:08, Paul wrote: ways to access those repetitive ", cc" s on the end.  I don't think my regex is capturing them. Some internets think you are in parser territory: https://stackoverflow.com/questions/1407435/how-do-i-regex-match-with-grouping-with-unknown-number-of-groups Ali

Re: regex matching but not capturing

2023-04-06 Thread Paul via Digitalmars-d-learn
On Thursday, 6 April 2023 at 16:27:23 UTC, Alex Bryan wrote: My understanding browsing the documentation is the matchAll returns a range of Captures (struct documented at https://dlang.org/phobos/std_regex.html#Captures). In your for loop I think c[0] will contain the current full match (curre

Re: regex matching but not capturing

2023-04-06 Thread Alex Bryan via Digitalmars-d-learn
On Thursday, 6 April 2023 at 15:52:16 UTC, Paul wrote: My regex is matching but doesnt seem to be capturing. You may recognize this from the AOC challenges. file contains... **Valve AA has flow rate=0; tunnels lead to valves DD, II, BB** **Valve BB has flow rate=13; tunnels lead to valves CC,