code: def splittext(text, search, attr):
      
      if search:
          pat = re.compile("({})".format(re.escape(search)), re.IGNORECASE)
      else:
          return text
      final = pat.split(text)
      final = [(attr, i) if i.lower() == search.lower() else i for i in final]
      return final
docs: Split a text string by search string and add Urwid display attribute to
      the search term.
  
      Args: text - string
            search - search string
            attr - attribute string to add
  
      Returns: urwid markup list ["string", ("default", " mo"), "re string"]
               for search="mo", text="string more string" and attr="default"