Very well spotted, Brian. Thanks. :-)
>
> Here's some FLI (foreign language intrinsic) COBOL, that is a one liner, heavy in use of extensions and your regex, taking into account the double escape problem of Python interpreting backslash, then the re engine doing the same. Everything doubles up to four each.
No, I don't think that's viable for me... :-)
>
> display python('import sys,re; result = re.sub("(?<!\\\\)$", "\\\\", sys.argv[1])', trim(Path trailing))
>
> You need a ./configure --with-python build of GnuCOBOL for that to work though.
At least you are supporting it...
>
> Or for in place update
>
> move python('import sys,re; result = re.sub("(?<!\\\\)$", "\\\\", sys.argv[1])', trim(Path trailing)) to Path
>
> Expensive, given the task at hand, not recommended really, but possible.
Very interesting, thanks.
I have used the MS Regex engine in the past, so I know it exists :-)
But I can't remember exactly how I linked to it and it would take me a
day to find the right libraries and get them into COBOL.
Maybe a simple, CALLable, COBOL pass-thru where you give it the Regex
and the target string and it returns the updated target or a Boolean if
you are only matching... Perhaps pass the Regex Groups back if you want
to be comprehensive. I thought I'd have tons of time in Retirement but
it isn't working out that way... Busier than ever :-)
>
> Have good
>
Thanks for the response, Brian, and best wishes for Gnu COBOL.