You need to use an \E to terminate an \L or \U otherwise they'll just keep going. So I would suggest an \E immediately after the capture group that represents the '-' in the replace expression (or before it).
\1\L\2\E\4\5\L\6
Or:
\1\L\2\4\E\5\L\6
I'm not at a computer where I can test the replace expression exactly.
I also think you don't need the brackets [] around each individual \p{Lu} instance.
Last edited by DiapDealer; 11-16-2023 at 09:29 PM.
|