, , : , \S, , , [^abc\d], , , (?![aeiou])\w ( , ). .
Unicode , - , - , : , \w,
Unicode. [^abc\d],
. ,
Unicode. Unicode,
, , , [0000-024F]
( ) [0590-074F] ( ).
You can then intercept each of these unicode code points, checking which ones match your regular expression:
import re
myregexp = r"[\dA-C]"
interest = [ (0x0000, 0x024F),
(0x0590, 0x06FF) ]
pattern = re.compile(myregexp)
matched = []
for low, high in interest:
matched.extend(chr(p) for p in range(low, high+1) if pattern.match(chr(p)))
>>> print("".join(matched))
0123456789ABC٠١٢٣٤٥٦٧٨٩۰۱۲۳۴۵۶۷۸۹
source
share