Regular expressions · exercise 1 of 1 · free preview
The game so far · chapter 22
Right now: The radio log is a mess of noise around ZONE- and code=.
This chapter's mission: Reads the garbled radio log. Work through the exercises, then your own code brings it to life.
re.search(pattern, text) finds the first match. A raw string r"..." keeps backslashes as they are. \d+ means one or more digits.
Search "level=42 noise" for r"\d+" and print the matched text with .group().