Page 1 of 1

Python: Metacharacters

Posted: Tue Apr 07, 2026 5:52 pm
by Jason

Code: Select all

import re

about_band_performance = "Shocking Blue performs the song Venus."

band_name = re.findall("^Sho.*ue$", about_band_performance)

# Read: String or strings found must start with "Sho" and be followed by any character with zero or more occurrences to be followed by "ue"

print(band_name)

# Displays ['Shocking Blue']