Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
import re html = "<p>First</p><p>Second</p>" greedy = re.findall(r"<p>.*</p>", html) non_greedy = re.findall(r"<p>.*?</p>", html) print(greedy) # ["<p>First</p><p>Second</p>"] print(non_greedy) # ["<p>First</p>", "<p>Second</p>"]
Result
Open