Re: Regex start/end position of match?

2015-10-01 Thread Gerald via Digitalmars-d-learn
Thanks Adam, that was the hint I needed. For a given RegexMatch the pre().length() is essentially equivalent to the start position and taking pre().length + hit.length() gives the end position so I think this should be OK for my needs.

Re: Regex start/end position of match?

2015-10-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 1 October 2015 at 03:29:29 UTC, Gerald wrote: I'm stuck though on how to get the start/end index of a match? I couldn't find one either so I did the pre/post/hit things broken up. Take a look at this little program I wrote: http://arsdnet.net/dcode/replacer/ All the files it n

Regex start/end position of match?

2015-09-30 Thread Gerald via Digitalmars-d-learn
I'm using the std.regex API as part of Linux GUI grep utility I'm trying to create. I've got the GUI going fine using gtkd, the code to iterate over files (wow that was succinct in D, very impressive!), and getting matches via regex using the matchAll function. I'm stuck though on how to get