I'm trying to learn how to use regex in python to scrape recipe ingredients off of a website. Using regex101 I have r".recipeIngredient(.*)"
which is matching just "recipeIngredient": [
And I'm trying to get it to match
"recipeIngredient": [
"1 ¾ cups HONEY MAID Graham Cracker Crumbs",
"⅓ cup butter, melted",
"1 ¼ cups sugar, divided",
"3 (8 ounce) packages PHILADELPHIA Cream Cheese, softened",
"1 cup BREAKSTONE'S or KNUDSEN Sour Cream",
"2 teaspoons vanilla",
"3 medium (blank)s eggs",
"1 (21 ounce) can cherry pie filling"
]```
Is ther a way to set parameters with regex to match everything between two [] but only after the "recipeIngredients"? Or would it be better for me to write a for loop to establish those parameters?
"cookTime": "P0DT0H0M",
"totalTime": "P0DT6H25M",
"recipeYield": "16 servings",
"recipeIngredient": [
"1 ¾ cups HONEY MAID Graham Cracker Crumbs",
"⅓ cup butter, melted",
"1 ¼ cups sugar, divided",
"3 (8 ounce) packages PHILADELPHIA Cream Cheese, softened",
"1 cup BREAKSTONE'S or KNUDSEN Sour Cream",
"2 teaspoons vanilla",
"3 medium (blank)s eggs",
"1 (21 ounce) can cherry pie filling"
],
"recipeInstructions": [
{
"@type": "HowToStep",
"text": "Heat oven to 350 degrees F.\n"
},