# Python3
r = re.compile(r"[\U0001f570\U0001f573\U0001f57a]")
This RegExp should find one of three emoji. Everything works correct, but PyCharm says:
"Duplicate character \U0001f573 inside character class"
"Duplicate character \U0001f57a inside character class"
If I change order, it says the same about 2nd and 3rd symbols, but never says about 1st one.
Is it a bug in PyCharm (maybe about about unicode surrogate pairs) or there is really something wrong with my RegExp?
UPDATE: Screenshot to be sure you get me right.
This was known bug. It was closed in 2020-09.
ran your code in my pycharm didn't get any errors:
PyCharm 2017.1 Build #PY-171.3780.115, built on March 24, 2017
JRE: 1.8.0_112-release-736-b13 amd64 JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 4.4.0-75-generic
try updating the ide
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With