> > I think you have to double the \s again in the function so that there> are 4 \s for each \ in the RE.
Thanks. This worked:
RETURN $1 ~''^[[:alnum:]_]+[[:space:]]+[[:alnum:]_]?\\.?[[:space:]]?[[:alnum:]_]+$'';