parameters: (regexp)
docstring: \
      Search for ports using a regular expression. Port name, description and
      hardware ID are searched. The function returns an iterable that returns the
      same tuples as comport() would do.
docstring_summary: \
      Search for ports using a regular expression. Port name, description and
      hardware ID are searched. The function returns an iterable that returns the
      same tuples as comport() would do.
docstring_tokens: \ Search for ports using a regular expression . Port name description and hardware ID are searched . The function returns an iterable that returns the same tuples as comport () would do .
function: def grep(regexp):
      """\
      Search for ports using a regular expression. Port name, description and
      hardware ID are searched. The function returns an iterable that returns the
      same tuples as comport() would do.
      """
      r = re.compile(regexp, re.I)
      for port, desc, hwid in comports():
          if r.search(port) or r.search(desc) or r.search(hwid):
              yield port, desc, hwid
function_tokens: def grep ( regexp ) : r = re . compile ( regexp , re . I ) for port , desc , hwid in comports ( ) : if r . search ( port ) or r . search ( desc ) or r . search ( hwid ) : yield port , desc , hwid