Skip to content

Commit ac08af3

Browse files
author
Charlotte Weaver
committed
Solution to lesson 10 project (DOC Clerk)
1 parent cc5b4b6 commit ac08af3

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
import re
3+
4+
paragraph = []
5+
found_match = False
6+
# Gold E. Locks (case insensitive, E. or E) Three bears or 3 bears 571 209-4000
7+
patterns = ['gold e\.? locks', 'three bears', '3 bears', '\(?571\)? ?209-?4000']
8+
with open('evidence.txt', 'r') as fh:
9+
for line in fh:
10+
if line == '\n':
11+
if found_match:
12+
print ''.join(paragraph)
13+
found_match = False
14+
paragraph = []
15+
16+
for pattern in patterns:
17+
if re.search(pattern, line, re.IGNORECASE):
18+
found_match = True
19+
paragraph.append(line)
20+

0 commit comments

Comments
 (0)