0

I have tried this regex (in this example it should match "BMW" and "ALL") in other programs, where it does work:

$ sed -E 's/\b(?<![A-Z]\s)\b[A-Z]{2,}\b(?!\s[A-Z][A-Z])\b/REPLACED/gm;t;d' <<< "this BMW is ALL But"

I get this error message:

>>> sed: -e expression #1, char 60: Invalid preceding regular expression

Does anyone know why it doesn't work in sed, and what the possible workaround is?

0 Answers0