-
Notifications
You must be signed in to change notification settings - Fork 0
/
scrap.py
46 lines (41 loc) · 1.4 KB
/
scrap.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
mircre = re.compile('('
'(?:'
'(?:\x03(?:1[0-5]|0?\\d)'
'(?:'
',(?:1[0-5]|0?\\d)'
')?'
')'
'|'
'\x02'
'|'
'\x1F'
'|'
'\x16'
')'
'|'
'^'
')'
'([^\x03\x02\x1F\x16]*)')
mircre = re.compile("""
(
(?:
\x03\\d{1,2}
(?:,\\d{1,2})?
)
|\x02|\x1F|\x16|^
)
([^\x03\x02\x1F\x16]*) #note: a \x03 with no numbers after it will get dropped off the face of the earth
""", re.VERBOSE)
mircre = re.compile("""
(
(?:
\x03
(?:
(?P<fg>\d\d?)
(?:,(?P<bg>\d\d?))?
)?
)
|\x02|\x1F|\x16|\x0F|^
)
([^\x02\x1F\x16\x03\x0F]*)
""", re.VERBOSE)