I've changed it to use /\A-?\d+(.\d+)?\z/ as regexp. It should not match multiline stuff anymore.