There is a known \"pattern\" to get the captured group value or an empty string if no match:
match = re.search(\'regex\', \'text\')
if match:
value = mat
Re: "Is there a simple and pythonic way to do this in one line?" The answer is no. Any means to get this to work in one line (without defining your own wrapper), is going to be uglier to read than the ways you've already presented. But defining your own wrapper is perfectly Pythonic, as is using two quite readable lines instead of a single difficult-to-read line.