code: def beta_code(self, text):
          
          text = text.upper().replace('-', '')
          for (pattern, repl) in self.pattern1:
              text = pattern.subn(repl, text)[0]
          for (pattern, repl) in self.pattern2:
              text = pattern.subn(repl, text)[0]
          # remove third run, if punct list not used
          for (pattern, repl) in self.pattern3:
              text = pattern.subn(repl, text)[0]
          return text
docs: Replace method. Note: regex.subn() returns a tuple (new_string,
          number_of_subs_made).