Regular expression for validating url in javascript

If you want to collect floating point numbers, use a non-integer for min or step.

Regular expressions can be used to perform all types of text search and text replace operations.In Java Script, regular expressions are often used with the two string methods: search() and replace().The search() method uses an expression to search for a match, and returns the position of the match.This will allow domain names with 2, 3 and 4 characters e.g.; us, tx, org, com, net, wxyz).On the final line we call test method for our regular expression and pass the email address as input.