> On Apr 7, 2018, at 3:05 AM, J Doe <gene...@nativemethods.com> wrote: > > Thank you for your reply. > > It occurred to me that I could side-step the issue of GNU extensions and > whether they’re supported by converting the string I e-mailed a couple of > e-mails back to full POSIX regex (in this case removing the \s). I ended up > with: > > > /^(Received:[[:space:]]from)[^;]+(;[[:space:]][A-Z]{1}[a-z]{2,3},)[[:space:]]+([[:digit:]]{1,2}[^\n]+)/ > REPLACE $1 [127.0.0.1] (localhost [127.0.0.1]) by myserver.com$2 $3 > > …and it works. > > Have I missed anything else that needs to be converted so that the regular > expression is POSIX only ?
It is now portable POSIX. For the record, in email the allowed whitespace is more narrow than is recognized by [[:space:]], you're not likely to run into any false positives. The email header whitespace consists of just SPACE, TAB, CR and LF. VT and FF (vertical tab and form feed) are not valid whitespace in email headers. -- Viktor.