Okay. I remember I tried a few different approaches, but that was the only one
that seemed to work.
If we didn't have to use sed it would be nice, but I haven't noticed a
performance penalty yet, since it is not a function that is called frequently.
I'm not sure what scoping tricks might work here, but I'll be very
interested in alternative approaches.
Otherwise, I submitted a PR for this one last week, if you decide it is
acceptable enough.
Luke