in reply to uppercase/lowercase in a single expression

Ah, but nobody's reply has solved the problem of swapping the case of letters while obeying locale (so that accented letters are handled).

s/([[:upper:]]*)([[:lower:]]*)/\L$1\U$2/g;

- tye