Python: Check for regex match
7 April 2024 (Updated 7 April 2024)
import re
# Outputs "Matched!"
if re.search(r"[A-Z]", "Sajad"):
print("Matched!")
else:
print("Not matched!")
Tagged:
Python
Thanks for your comment 🙏. Once it's approved, it will appear here.
Leave a comment