how to write python program to parse a STRING & identify which of the following patterns input string belongs & give all the matching patterns in o/p [closed]

  python, regex, string

[{"record id" : "12345",
"person id" : "4567",
"person_name" : "Scott",
"beagle_masterpersonid" : "0",
"masterpersonid" : "568",
"datasource" : "sheriff",
"convicted_of" : "murder",
"record" : "xyz",
"record_title": "police",
"record_insertdate" : "10-4-2021",
"record_date" : "15-04-2021",
"occur_from" : "sheriff",
"occur_to": "covicted",
"record_description" : "cbnvhjdi" ,
"activity" : "arrested",
"receiving_agency" : "central",
"detention_facility" : "police station",
"detention_status" : "arrested",
"codesection" : "no",
"severity_level" : "3 months",
"case_disposition" : "settled",
"summary" : "acfvdv",
"officer_name" : "charles",
"officer_agency" : "LA",
"officer_badge" : "125897",
"offense" : "murder",
"record_subtype" : "NA",
"record_status" : "arrested",
"disposition_datetime" : "20-04-2021",
"court_name" : "LA Court",
"updatedatetime" : "20-04-2021 15:30:55",
"personrecordid" : "86549",
"recordvehicleid" :"NA",
"recordpropertyid": "home",
"recordweaponid" : "Gun",
"recordaddressid" : "158"}]

desired output :
if "Scott" is entered, program have to check how many patterns are matched and displayed in the output.

Source: Python Questions

LEAVE A COMMENT