It replaces every character in that character class (basically: the unusual ASCII control characters, plus anything outside ASCII) with:
- opening square bracket, followed by
- capital letter "U", followed by
- plus sign, followed by
- the numeric value of character being replaced, in uppercase hexadecimal, padded to a minimum of four digits, followed by
- closing square bracket
It's a regular expression I use quite... regularly. It makes any non-ASCII characters stick out like a sore thumb, so you can see exactly what characters are in your string.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
| [reply] |