summaryrefslogtreecommitdiff
path: root/examples/parseResultsSumExample.py
diff options
context:
space:
mode:
authorJon Dufresne <jon.dufresne@gmail.com>2019-10-31 21:10:28 -0700
committerPaul McGuire <ptmcg@users.noreply.github.com>2019-10-31 23:10:28 -0500
commit53d1b4a6f48a53c4c4ec4ac7031362b691c0366d (patch)
tree088ad3cf3561b78a00af4fb2fd474f4a2b8ca70c /examples/parseResultsSumExample.py
parent41752aa52cc97c710474bb2972cceab057b52ad4 (diff)
downloadpyparsing-git-53d1b4a6f48a53c4c4ec4ac7031362b691c0366d.tar.gz
Blacken the project (#141)
Diffstat (limited to 'examples/parseResultsSumExample.py')
-rw-r--r--examples/parseResultsSumExample.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/parseResultsSumExample.py b/examples/parseResultsSumExample.py
index 2c0f9fc..2341b7c 100644
--- a/examples/parseResultsSumExample.py
+++ b/examples/parseResultsSumExample.py
@@ -10,13 +10,19 @@ samplestr3 = "garbage;DOB 10-10-2010"
samplestr4 = "garbage;ID PARI12345678;more garbage- I am cool"
from pyparsing import *
+
dob_ref = "DOB" + Regex(r"\d{2}-\d{2}-\d{4}")("dob")
-id_ref = "ID" + Word(alphanums,exact=12)("id")
+id_ref = "ID" + Word(alphanums, exact=12)("id")
info_ref = "-" + restOfLine("info")
person_data = dob_ref | id_ref | info_ref
-for test in (samplestr1,samplestr2,samplestr3,samplestr4,):
+for test in (
+ samplestr1,
+ samplestr2,
+ samplestr3,
+ samplestr4,
+):
person = sum(person_data.searchString(test))
print(person.id)
print(person.dump())