How to write the \U unicode format in Python regex
This is rather unrelated to regex but only to the way of using \u and \U prefixes in Python strings.
In plain text, the Unicode characters are commonly represented as U + code, for example U+0041 for the character A. But inside Python strings, you can use either \u followed with 4 hexadecimal digits or \U followed with 8 ones. For example you can write '\u0041\U00000042' to get 'AB'. Or simply \x followed with 2 hexa digits if the code point is less than 256: '\x41', still for 'A'.
Read more here: Source link
