Use regsubex instead
alias -l html return $regsubex($1,/(?:^|<)[^<>]+>|(?:<[^>]+$)| /g,)
For those wondering, $regsub (Not to be confused with $regsubex) is an older way of doing RegExp substitutions. It returns the number of substitutions made(?), and fills an output variable with the resulting text:
$regsub(<input string>,/pattern/,replacement text,%outputvar)