## ~jonjfineman/callerID

66f5aa86864e052627ee6a57b1faab9eebe1e4a0 — Jon Fineman 2 years ago
```add re expression to call block function
```
```1 files changed, 7 insertions(+), 1 deletions(-)

M callBlock.py
```
`M callBlock.py => callBlock.py +7 -1`
```@@ 321,7 321,7 @@ def checkSilentList(number, name, book):
n = i.split(':')
#print("book: ", i, n[1])
if name == n[1] and '*' == n[0]:
-            print('checkSilentList for name {}, found: {}, {}'.format(name, n[0], n[1]))
+            log.debug('checkSilentList for name {}, found: {}, {}'.format(name, n[0], n[1]))
return([True, n[0], n[1]])
# check if regular expression (single quote as first char)
elif n[1][0:1] == "'" and '*' == n[0]:

@@ 351,6 351,12 @@ def checkBlockList(number, name, book):
elif name == n[1] and number[:3] == n[0]:
log.debug('checkBlockList exchange for {}, found: {}, {}'.format(name, n[0], n[1]))
return([True, n[0], n[1]])
+        elif n[1][0:1] == "'" and '*' == n[0]:
+            n[1] = n[1][1:]
+            #print('n: ', n[1], 'name: ', name)
+            if re.search(n[1], name) != None:
+                print('checkSilentList for re name {}, found: {}, {}'.format(name, n[0], n[1]))
+                return([True, n[0], n[1]])

log.debug('checkBlockList no match: {}, {}'.format(number, name))

```