#include <StringConstants.au3> ; to declare the Constants of StringRegExp
#include <Array.au3> ; UDF needed for _ArrayDisplay and _ArrayConcatenate
Local $sRegex = "(?m)^(<\!\-\- wp:onecms\/recipe-time \{\"type\"\:\"cook\")\S(.*[a-z\:0-9\}\s])(\/\-\->)$"
Local $sString = "<!-- wp:onecms/recipe-header {"dek":"\u003cp\u003eHungry for some \u003ca href=\u0022https://www.southernliving.com/recipes/old-fashioned-apple-pie\u0022\u003eapple pie\u003c/a\u003e? We are right there with you. Here's the recipe from the Whispering Canyon Café at Disney’s Wilderness Lodge—dessert will never be the same.\u003c/p\u003e"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/primary-media /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-media /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-container -->" & @CRLF & _
"<!-- wp:onecms/recipe-details -->" & @CRLF & _
"<!-- wp:onecms/recipe-metadata {"yieldDescription":"Makes one 9-inch pie."} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-times -->" & @CRLF & _
"<!-- wp:onecms/recipe-time {"type":"hands-on","days":0,"hours":0,"minutes":45} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-time {"type":"cook","days":0,"hours":1,"minutes":0} /-->" & @CRLF & _
"<!-- /wp:onecms/recipe-times -->" & @CRLF & _
"<!-- /wp:onecms/recipe-details -->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredients -->" & @CRLF & _
"<!-- wp:onecms/recipe-section-header {"content":"Pie Crust"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"butter, cut into small pieces","customMeasure":"tablespoons","customQuantity":"4"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"shortening","customMeasure":"cup","customQuantity":"0.25"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"all-purpose flour","customMeasure":"cups","customQuantity":"1.75"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"sugar","customMeasure":"teaspoons","customQuantity":"4"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"coarse salt","customMeasure":"teaspoon","customQuantity":"0.13"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"2% milk","customMeasure":"cup","customQuantity":"0.33"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-section-header {"content":"Apples"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"water","customMeasure":"cup","customQuantity":"1"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"Granny Smith apples, peeled and sliced","customQuantity":"6"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"apple pie spice","customMeasure":"teaspoon","customQuantity":"2"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-section-header {"content":"Apple Pie Batter"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"butter, softened","customMeasure":"cup","customQuantity":"0.5"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"sugar","customMeasure":"cup","customQuantity":"0.67"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"eggs","customQuantity":"2"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"flour","customMeasure":"cups","customQuantity":"1.5"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"baking powder","customMeasure":"teaspoon","customQuantity":"1.5"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"salt","customMeasure":"teaspoon","customQuantity":"0.13"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-ingredient-custom {"customIngredient":"heavy cream","customMeasure":"cup","customQuantity":"0.25"} /-->" & @CRLF & _
"<!-- /wp:onecms/recipe-ingredients -->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-nutrition {"displayNutritionRecipe":false} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-directions -->" & @CRLF & _
"<!-- wp:onecms/recipe-direction {"directionId":"ddaa1eec-7bec-4284-b4e3-53b35cb83941","content":"\u003cstrong\u003eFOR PIE CRUST: \u003c/strong\u003e"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-direction {"directionId":"e546e3c3-96a5-4be5-94fa-34ee625f3a48","content":"\u003cstrong\u003eFOR APPLES:\u003c/strong\u003e"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-direction {"directionId":"49fbc0c6-12f0-420c-9dc6-19210620e023","content":"\u003cstrong\u003eFOR APPLE PIE BATTER:\u003c/strong\u003e"} /-->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-direction {"directionId":"208717df-e3e3-43e9-a2bc-35ad854ae43c","content":"\u003cstrong\u003eFOR APPLE PIE:\u003c/strong\u003e"} /-->" & @CRLF & _
"<!-- /wp:onecms/recipe-directions -->" & @CRLF & _
"" & @CRLF & _
"<!-- wp:onecms/recipe-notes -->" & @CRLF & _
"<!-- wp:onecms/recipe-note /-->" & @CRLF & _
"<!-- /wp:onecms/recipe-notes -->" & @CRLF & _
"<!-- /wp:onecms/recipe-container -->"
Local $aArray = StringRegExp($sString, $sRegex, $STR_REGEXPARRAYGLOBALFULLMATCH)
Local $aFullArray[0]
For $i = 0 To UBound($aArray) -1
_ArrayConcatenate($aFullArray, $aArray[$i])
Next
$aArray = $aFullArray
; Present the entire match result
_ArrayDisplay($aArray, "Result")
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 AutoIt, please visit: https://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm