Regular expression for validating website
Can you add a CAPTCHA to Google forms to prevent spam bots?
Can you include a profanity filter to block people from submitting entries that include obscene words?
In this article I’ll cover two useful regular expressions that often come in handy when writing validation logic for a Web page.
Most programmers will find they need to either validate a URL or an Email at some point, and the example expressions below are the most commonly used versions of each expression.
I’m not sure who originally created each of these expressions, so I have no idea who I can give the credit for these to, but they have helped me often.
Bottom line for these two examples is that I like to use the example expressions found in an article on Net Tuts /and modify them to meet my needs.
You have created a form and it has all the standard fields where candidates can enter their name, email address, website URL, phone number, zip code and other essential details.When you are expecting dozens, or even hundreds, of responses in your Google Forms, it is always a good idea to have some rules in place and respondents data should be matched against these rules even before they submit the form.For instance, if your form is asking for a person’s year of birth, they should only be allowed to enter a number between 19.The easiest and safest way to check whether an email address is well-formed is to use PHP's filter_var() function.trait which provides a convenient method to validate incoming HTTP request with a variety of powerful validation rules.