// include the latest version of the regex crate in your Cargo.toml
extern crate regex;
use regex::Regex;
fn main() {
let regex = Regex::new(r#"(?m)"[a-zA-Z0-9 -\/\[\]_:.\(\)@\"\-,]*",|["[a-zA-Z0-9 -\/\[\]_:.\(\)@\"\-,]*"],|},"#).unwrap();
let string = "{
\"slug\": \"submit/82276720931155/\",
\"file_server\": \"go-sub3\",
\"temp_upload\": {
\"q95_input95\": [\"iShares-Fund-Changes-June-2018-vF.PDF\"]
},
\"q44_gi_LegalEntityName\": \"Test 96\",
\"q43_gi_Address\": {
\"addr_line1\": \"96\",
\"addr_line2\": \"\",
\"city\": \"New York\",
\"state\": \"NY\",
\"postal\": \"10096\",
\"country\": \"United States\"
},
\"q45_gi_PhoneNumber\": {
\"full\": \"(969) 696-9696\"
},
\"q47_gi_FaxNumber\": {
\"full\": \"\"
},
\"q48_gi_CompanyWebsite\": \"\",
\"q49_gi_DateOfIncorporation\": {
\"year\": \"\",
\"month\": \"\",
\"day\": \"\"
},
\"q50_gi_StateOfIncorporation\": {
\"addr_line1\": \"\",
\"addr_line2\": \"\",
\"city\": \"\",
\"state\": \"\",
\"postal\": \"\",
\"country\": \"\"
},
\"q51_gi_TaxID\": \"96\",
\"q58_gi_RegulatoryAuth\": \"\",
\"q59_gi_LeiNumber\": \"\",
\"q60_gi_LargeTraderID\": \"\",
\"q62_gi_ComplianceContact\": {
\"first\": \"\",
\"last\": \"\"
},
\"q64_gi_ComplianceEmail\": \"\",
\"q63_gi_CompliancePhoneNumber\": {
\"full\": \"\"
},
\"q67_gi_IsSubsidiaryName\": \"\",
\"q68_gi_IsSubsidiaryAddress\": \"\",
\"q69_gi_IsSubsidiaryJurisdiction\": \"\",
\"q70_gi_IsSubsidiaryRegulator\": \"\",
\"q75_sc_OpsContact\": {
\"first\": \"\",
\"last\": \"\"
},
\"q77_sc_OpsEmail\": \"\",
\"q76_sc_OpsPhone\": {
\"full\": \"\"
},
\"q80_sc_OmgeoAcronym\": \"\",
\"q81_sc_OmgeoAccessCode\": \"\",
\"q82_sc_DTCNumber\": \"\",
\"q83_sc_MPID\": \"\",
\"q84_sc_AgentBankNumber\": \"\",
\"q85_sc_InternalAccountNumber\": \"\",
\"q86_sc_InstDelivery\": \"\",
\"q87_sc_InterestedPartyID\": \"\",
\"q88_sc_Custodian\": \"\",
\"q89_sc_Euroclear\": \"\",
\"q90_sc_Cedel\": \"\",
\"q92_sc_ConfirmsEmail\": \"\",
\"q101_ct_InstitutionalDVP\": {
\"other\": \"\"
},
\"q102_ct_InstitutionalDVPTypePublicDescription\": \"\",
\"q108_ct_SectionA\": [\"Trust Co.\"],
\"q114_ct_SectionC\": {
\"other\": \"\"
},
\"q116_id_SectionA\": {
\"0\": \"For a corporation, a Corporate Resolution and, if available, incorporation documents such as Articles of Incorporation and By-Laws\",
\"other\": \"\"
},
\"q121_ac_ControllingCustomerRelationship\": \"\",
\"q123_ac_RegulatorBeneficialOwner\": \"No\",
\"q125_ac_AccountBase\": \"\",
\"q130_ac_CommercialEntity\": \"\",
\"q132_ac_CommercialEntityOutsideUSFundsCountry\": {
\"addr_line1\": \"\",
\"addr_line2\": \"\",
\"city\": \"\",
\"state\": \"\",
\"postal\": \"\",
\"country\": \"\"
},
\"q152_ac_ConfirmNeitherPrivBank\": {
\"other\": \"\"
},
\"q138_ac_CustomerRelationship\": \"Hi\",
\"q161_signature\": \"Signed by David Test (dd@brownstone.com)\",
\"q56_approvalStatus\": \"\",
\"q159_ip\": \"\",
\"q57_typeA\": \"https://form.jotform.com/82276720931155\",
\"event_id\": \"1537887682362_82276720931155_ZPG71XZ\",
\"q66_gi_IsSubsidiary\": \"\",
\"q78_sc_Omgeo\": \"\",
\"q91_sc_Confirms\": \"\",
\"q97_sc_StructuredSecurities\": \"\",
\"q98_sc_StructuredSecuritiesUnderstand\": \"\",
\"q105_ct_MunicipalEntity\": \"\",
\"q109_ct_SectionA2\": \"\",
\"q111_ct_SectionB\": \"\",
\"q112_ct_SectionBRelyingAdviser\": \"\",
\"q120_ac_ControllingCustomer\": \"\",
\"q126_ac_AMLProgram\": \"\",
\"q128_ac_AMLRepresentationType\": \"\",
\"q131_ac_CommercialEntityOutsideUSFunds\": \"\",
\"q133_ac_CommercialEntityOutsideUSPresence\": \"\",
\"q134_ac_CommercialEntityOutsideUSServiceShellBanks\": \"\",
\"q157_id_SectionANA\": \"\",
\"input95\": [\"https://www.jotform.com/uploads/ddinner/82276720931155/4136970043522095790/iShares-Fund-Changes-June-2018-vF.PDF\"]
}
";
// result will be an iterator over tuples containing the start and end indices for each match in the string
let result = regex.captures_iter(string);
for mat in result {
println!("{:?}", mat);
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Rust, please visit: https://docs.rs/regex/latest/regex/