use strict;
my $str = '{"slug":"submit/232887476259070","submit_source":"form","jsExecutionTracker":"start-1698348777152->ready-start-1699505460643->validator-called-1699505460748->validator-pre-mount-false-1699505460748->validator-post-mount-true-1699505460748->ready-done-1699505460770->submit-validation-isvalid-1699505570943","submitSource":"submit1699505570941","q261_sid":"5739896230157407925","q17_POnumber":"2611","q18_brandclient":"Bloom","q19_cuTaskname":"PO#261-1 Live Resin","q20_invoiceNotes":"PO261-1 1g vape-7,000, .5g surf-9,800, 1g Surf-19,600","q5_name1":"Apple Fritter","q15_stype1":"Packaging Services","q7_qty1":"1000","q8_price1":"3.34","q16_type1":"Sauce","q26_colab1":"NOT Collab","q14_colabbrand1":"BLFAFR","q10_origin1":"","q11_metrc1":"1A40603000067EB000052302","q12_rnd1":"","q13_secunit1":"90","q27_name2":"Apple Fritter","q28_stype2":"Packaging Services","q29_qty2":"1400","q30_price2":"2.52","q31_type2":"Sauce","q32_colab2":"NOT Collab","q33_colabbrand2":"BLD5AFR","q34_origin2":"","q35_metrc2":"1A40603000067EB000052303","q36_rnd2":"","q37_secunit2":"90","q39_name3":"Apple Fritter","q40_stype3":"Packaging Services","q41_qty3":"2800","q42_price3":"3.31","q43_type3":"Sauce","q44_colab3":"NOT Collab","q45_colabbrand3":"BLD1AFR","q46_origin3":"","q47_metrc3":"1A40603000067EB000052304","q48_rnd3":"","q49_secunit3":"90","q51_name4":"Blueberry Gushers","q52_stype4":"Packaging Services","q53_qty4":"1000","q54_price4":"3.34","q55_type4":"Sauce","q56_colab4":"NOT Collab","q57_colabbrand4":"BLFBGU","q58_origin4":"","q59_metrc4":"1A40603000067EB000052305","q60_rnd4":"","q61_secunit4":"90","q63_name5":"Blueberry Gushers","q64_stype5":"Packaging Services","q65_qty5":"1400","q66_price5":"2.52","q67_type5":"Sauce","q68_colab5":"NOT Collab","q69_colabbrand5":"BLD5BGU","q70_origin5":"","q71_metrc5":"1A40603000067EB000052306","q72_rnd5":"","q73_secunit5":"90","q75_name6":"Blueberry Gushers","q76_stype6":"Packaging Services","q77_qty6":"2800","q78_price6":"3.31","q79_type6":"Sauce","q80_colab6":"NOT Collab","q81_colabbrand6":"BLD1BGU","q82_origin6":"","q83_metrc6":"1A40603000067EB000052307","q84_rnd6":"","q85_secunit6":"90","q87_name7":"Cereal Milk","q88_stype7":"Packaging Services","q89_qty7":"1000","q90_price7":"3.34","q91_type7":"Sauce","q92_colab7":"NOT Collab","q93_colabbrand7":"BLFCMK","q94_origin7":"","q95_metrc7":"1A40603000067EB000052308","q96_rnd7":"","q97_secunit7":"90","q99_name8":"Cereal Milk","q100_stype8":"Packaging Services","q101_qty8":"1400","q102_price8":"2.52","q103_type8":"Sauce","q104_colab8":"NOT Collab","q105_colabbrand8":"BLD5CMK","q106_origin8":"","q107_metrc8":"1A40603000067EB000052309","q108_rnd8":"","q109_secunit8":"90","q111_name9":"Cereal Milk","q112_stype9":"Packaging Services","q113_qty9":"2800","q114_price9":"3.31","q115_type9":"Sauce","q116_colab9":"NOT Collab","q117_colabbrand9":"BLD1CMK","q118_origin9":"","q119_metrc9":"1A40603000067EB000052310","q120_rnd9":"","q121_secunit9":"90","q123_name10":"Citrus Punch","q124_stype10":"Packaging Services","q125_qty10":"1000","q126_price10":"3.34","q127_type10":"Sauce","q128_colab10":"NOT Collab","q129_colabbrand10":"BLFCPH","q130_origin10":"","q131_metrc10":"1A40603000067EB000052311","q132_rnd10":"","q133_secunit10":"90","q135_name11":"Citrus Punch","q136_stype11":"Packaging Services","q137_qty11":"1400","q138_price11":"2.52","q139_type11":"Sauce","q140_colab11":"NOT Collab","q141_colabbrand11":"BLD5CPH","q142_origin11":"","q143_metrc11":"1A40603000067EB000052312","q144_rnd11":"","q145_secunit11":"90","q147_name12":"Citrus Punch","q148_stype12":"Packaging Services","q149_qty12":"2800","q150_price12":"3.31","q151_type12":"Sauce","q152_colab12":"NOT Collab","q153_colabbrand12":"BLD1CPH","q154_origin12":"","q155_metrc12":"1A40603000067EB000052313","q156_rnd12":"","q157_secunit12":"90","q159_name13":"Lemon Jack","q160_stype13":"Packaging Services","q161_qty13":"1000","q162_price13":"3.34","q163_type13":"Sauce","q164_colab13":"NOT Collab","q165_colabbrand13":"BLFLJK","q166_origin13":"","q167_metrc13":"1A40603000067EB000052314","q168_rnd13":"","q169_secunit13":"90","q171_name14":"Lemon Jack","q172_stype14":"Packaging Services","q173_qty14":"1400","q174_price14":"2.52","q175_type14":"Sauce","q176_colab14":"NOT Collab","q177_colabbrand14":"BLD5LJK","q178_origin14":"","q179_metrc14":"1A40603000067EB000052315","q180_rnd14":"","q181_secunit14":"90","q183_name15":"Lemon Jack","q184_stype15":"Packaging Services","q185_qty15":"2800","q186_price15":"3.31","q187_type15":"Sauce","q188_colab15":"NOT Collab","q189_colabbrand15":"BLD1LJK","q190_origin15":"","q191_metrc15":"1A40603000067EB000052316","q192_rnd15":"","q193_secunit15":"90","q195_name16":"London Pound Cake","q196_stype16":"Packaging Services","q197_qty16":"1000","q198_price16":"3.34","q199_type16":"Sauce","q200_colab16":"NOT Collab","q201_colabbrand16":"BLFLPC","q202_origin16":"","q203_metrc16":"1A40603000067EB000052317","q204_rnd16":"","q205_secunit16":"90","q207_name17":"London Pound Cake","q208_stype17":"Packaging Services","q209_qty17":"1400","q210_price17":"2.52","q211_type17":"Sauce","q212_colab17":"NOT Collab","q213_colabbrand17":"BLD5LPC","q214_origin17":"","q215_metrc17":"1A40603000067EB000052318","q216_rnd17":"","q217_secunit17":"90","q219_name18":"London Pound Cake","q220_stype18":"Packaging Services","q221_qty18":"2800","q222_price18":"3.31","q223_type18":"Sauce","q224_colab18":"NOT Collab","q225_colabbrand18":"BLD1LPC","q226_origin18":"","q227_metrc18":"1A40603000067EB000052319","q228_rnd18":"","q229_secunit18":"90","q231_name19":"Sour Diesel","q232_stype19":"Packaging Services","q233_qty19":"1000","q234_price19":"3.34","q235_type19":"Sauce","q236_colab19":"NOT Collab","q237_colabbrand19":"BLFSDL","q238_origin19":"","q239_metrc19":"1A40603000067EB000052320","q240_rnd19":"","q241_secunit19":"90","q243_name20":"Sour Diesel","q244_stype20":"Packaging Services","q245_qty20":"1400","q246_price20":"2.52","q247_type20":"Sauce","q248_colab20":"NOT Collab","q249_colabbrand20":"BLD5SDL","q250_origin20":"","q251_metrc20":"1A40603000067EB000052321","q252_rnd20":"","q253_secunit20":"90","q262_name21":"Sour Diesel","q263_stype21":"Packaging Services","q264_qty21":"2800","q265_price21":"3.31","q266_type21":"Sauce","q267_colab21":"NOT Collab","q268_colabbrand21":"BLD1SDL","q269_origin21":"","q270_metrc21":"1A40603000067EB000052322","q271_rnd21":"","q272_secunit21":"90","event_id":"1699505460751_232887476259070_yHe1f3B","validatedNewRequiredFieldIDs":"\\"No validated required fields\\"","path":"/submit/232887476259070"}';
my $regex = qr/"q\d+_name\d+":"(?<name>.*?)","q\d+_stype\d+":"(?<stype>.*?)","q\d+_qty\d+":"(?<qty>.*?)","q\d+_price\d+":"(?<price>.*?)","q\d+_type\d+":"(?<type>.*?)","q\d+_colab\d+":"(?<colab>.*?)","q\d+_colabbrand\d+":"(?<colabbrand>.*?)","q\d+_origin\d+":"(?<origin>.*?)","q\d+_metrc\d+":"(?<metrc>.*?)","q\d+_rnd\d+":"(?<rnd>.*?)","q\d+_secunit\d+":"(?<secunit>.*?)"/p;
if ( $str =~ /$regex/g ) {
print "Whole match is ${^MATCH} and its start/end positions can be obtained via \$-[0] and \$+[0]\n";
# print "Capture Group 1 is $1 and its start/end positions can be obtained via \$-[1] and \$+[1]\n";
# print "Capture Group 2 is $2 ... and so on\n";
}
# ${^POSTMATCH} and ${^PREMATCH} are also available with the use of '/p'
# Named capture groups can be called via $+{name}
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 Perl, please visit: http://perldoc.perl.org/perlre.html