regex for finding gene product from the text

import re
test_str = ' /product="hypothetical protein"'
match = re.search(r'product="([^"]+)"', test_str)
if match:
    print(match.group(1))

--------------------------------------------------------------------------------
  product="                'product="'
--------------------------------------------------------------------------------
  (                        group and capture to \1:
--------------------------------------------------------------------------------
    [^"]+                    any character except: '"' (1 or more
                             times (matching the most amount
                             possible))
--------------------------------------------------------------------------------
  )                        end of \1
--------------------------------------------------------------------------------
  "                        '"'

Read more here: Source link