blob: ff1ff5fbd874fc6811bb389d96d20a7f7c96806c (
about) (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
import re
from typing import Iterable
def findcommands(mailtext:str) -> Iterable[re.Match]:
return re.finditer(r'\n(' # match any of:
r'STATUS (OPEN|CLOSED|UNCONF|REJECT|UPSTRM)|' # a status change, STATUS <state>
r'TYPE (BUG|DISCUS|PATCH)|' # a type change, TYPE <type>
r'SUBJECT .*|' # a subject change, SUBJECT <any valid text without newlines>
r'DESCRIPTION( @[0-9]*(:[0-9]*)?)?\r?\n(.*|\r?\n)*\r?\nDESCRIPTION END|' # DESCRIPTION [@<startingline[:<endingline]]\n<any valid text including newlines>\nEND DESCRIPTION
r'(UN)?PERMIT .*)' # change command permission for an emailaddress, (UN)PERMIT <email>
,mailtext)
|