Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
import re pattern = r"(\d{4})-(\d{2})-(\d{2})" match = re.search(pattern, "Date: 2024-07-15") if match: year, month, day = match.groups() print(year, month, day) # 2024 07 15
Result
Open