⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.118
Server IP:
77.37.48.208
Server:
Linux sg-nme-web1518.main-hosting.eu 5.14.0-611.16.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Mon Dec 22 03:40:39 EST 2025 x86_64
Server Software:
LiteSpeed
PHP Version:
8.3.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
opt
/
gsutil
/
third_party
/
pyparsing
/
examples
/
View File Name :
parse_results_sum_example.py
# # parseResultsSumExample.py # # Sample script showing the value in merging ParseResults retrieved by searchString, # using Python's builtin sum() method # samplestr1 = "garbage;DOB 10-10-2010;more garbage\nID PARI12345678;more garbage" samplestr2 = "garbage;ID PARI12345678;more garbage\nDOB 10-10-2010;more garbage" samplestr3 = "garbage;DOB 10-10-2010" samplestr4 = "garbage;ID PARI12345678;more garbage- I am cool" from pyparsing import Regex, Word, alphanums, rest_of_line dob_ref = "DOB" + Regex(r"\d{2}-\d{2}-\d{4}")("dob") id_ref = "ID" + Word(alphanums, exact=12)("id") info_ref = "-" + rest_of_line("info") person_data = dob_ref | id_ref | info_ref for test in ( samplestr1, samplestr2, samplestr3, samplestr4, ): person = sum(person_data.search_string(test)) print(person.id) print(person.dump()) print()