I need to match the text inside <p>
element excluding the first <strong>
element from the text.
When tested on an online regex tester like https://regexr.com/ it works fine, but when I run on my python script, it doesn't matches anything.
Regex:
<br>(.*)<\/p>$
Text:
<p><strong>Ackee and Saltfish Fritters</strong><br>\n2 cup salted Cod fish, soaked overnight<br>\n2 cloves garlic<br>\n½ medium onion<br>\n1 tsp thyme<br>\n1 tbsp cilantro<br>\n1 scallion, finely chopped<br>\n¼ scotch bonnet pepper, seeds removed<br>\n1 cup all purpose flour<br>\n1 tsp baking powder<br>\n½ cup ackee<br>\n¾ cup water<br>\nCanola oil</p>
Python code:
re.search(r"<br>(.*)<\/p>$", target_string)
Desired result in matches group 1:
\n2 cup salted Cod fish, soaked overnight<br>\n2 cloves garlic<br>\n½ medium onion<br>\n1 tsp thyme<br>\n1 tbsp cilantro<br>\n1 scallion, finely chopped<br>\n¼ scotch bonnet pepper, seeds removed<br>\n1 cup all purpose flour<br>\n1 tsp baking powder<br>\n½ cup ackee<br>\n¾ cup water<br>\nCanola oil
<p>
text, but need to extract the lines from it now without the<strong>
element.