I'm trying to capture and match russian language characters in a python script. Since russian characters don't fall in [a-Z] type, what regex should I should to match them. I can't use a (.*) because it would match everything.
linkpat = re.compile('name=[a-Z]+;size=[0-9]+')
Use unicode flag:
re.compile('name=\w+;size=\d+', re.U)
this would also match any letter in any language (plus underscore), not just Russian, though.
You can try \w with the correct LOCALE
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