On 2023-01-15 Su 18:37, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> Those replacement lines are very difficult to read. I think use of
>> extended regexes and some multi-part replacements would help. I'll have
>> a go at that tomorrow.
> Yeah, after I wrote that code I remembered about \Q ... \E, which would
> eliminate the need for most of the backslashes and probably make things
> better that way. I didn't get around to improving it yet though, so
> feel free to have a go.
>
>
OK, here's my version. It tests clean against all of crake's dump files
back to 9.2.
To some extent it's a matter of taste, but I hate very long regex lines
- it makes it very hard to see what's actually changing, so I broke up
most of those.
Given that we are looking at newlines in some places I decided that
after all it was important to convert CRLF to LF.
cheers
andrew
--
Andrew Dunstan
EDB: https://www.enterprisedb.com