demo_regex_match_group.py:
import re #Search for an upper case "S" character in the beginning of a word, and print the word: str = "The rain in Spain" x = re.search(r"\bS\w+", str) print(x.group())
➜ begtut>python demo_regex_match_group.py
Spain