code: def search(table, *args, **kwargs):
      
  
      if len(args) == 1:
          field = None
          pattern = args[0]
      elif len(args) == 2:
          field = args[0]
          pattern = args[1]
      else:
          raise ArgumentError('expected 1 or 2 positional arguments')
      return SearchView(table, pattern, field=field, **kwargs)
docs: Perform a regular expression search, returning rows that match a given
      pattern, either anywhere in the row or within a specific field. E.g.::
  
          >>> import petl as etl
          >>> table1 = [['foo', 'bar', 'baz'],
          ...           ['orange', 12, 'oranges are nice fruit'],
          ...           ['mango', 42, 'I like them'],
          ...           ['banana', 74, 'lovely too'],
          ...           ['cucumber', 41, 'better than mango']]
          >>> # search any field
          ... table2 = etl.search(table1, '.g.')
          >>> table2
          +------------+-----+--------------------------+
          | foo        | bar | baz                      |
          +============+=====+==========================+
          | 'orange'   |  12 | 'oranges are nice fruit' |
          +------------+-----+--------------------------+
          | 'mango'    |  42 | 'I like them'            |
          +------------+-----+--------------------------+
          | 'cucumber' |  41 | 'better than mango'      |
          +------------+-----+--------------------------+
  
          >>> # search a specific field
          ... table3 = etl.search(table1, 'foo', '.g.')
          >>> table3
          +----------+-----+--------------------------+
          | foo      | bar | baz                      |
          +==========+=====+==========================+
          | 'orange' |  12 | 'oranges are nice fruit' |
          +----------+-----+--------------------------+
          | 'mango'  |  42 | 'I like them'            |
          +----------+-----+--------------------------+
  
      The complement can be found via
      :func:`petl.transform.regex.searchcomplement`.