String manipulation. Ambiguous return type

Hello guys. I need to write an expression, which clean data. But at the end I run into problem “Ambiguous return type”

Expression:

if((regexMatches($Materialtext$, “.?(\d+x\d+).”)))

(regexReplace($Materialtext$, “.?(\d+x\d+).”, “$1”))

else

“”