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.
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
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