Regular expression for validating first name


In the case of online forms, you can write a generic script that uses regular expressions for a quick test and validation of the data supplied by your customers.You can also extend that script with just a little more work to format data automatically as the customer enters it—for example, adding hyphens in the right places to phone and credit-card numbers.Character Limit – the default text box in a Google form allows users to input any number of characters but you can impose a limit with the help of regular expression.

regular expression for validating first name-5

Regular expression for validating first name

And many scripts are customized to a specific form so that each change to the form requires more work on the developer's part, adding and deleting code from a single, monolithic validation function.

One way to get around some of these limitations is to use regular expressions.

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?

URL (Web domain) – this is useful for fields that require the user to enter their website address and it even matches the upcoming TLDs like .directory or .restaurant.