How I can simplify it: params[:value] =~ /^\d+$|^-\d+$|^\d+\.\d+$|^-\d+\.\d+$/ -- Posted via http://www.ruby-forum.com/.