ASP.NET Word Count Validator

How to validate the wordcount on a textbox? Use a regular expression validator. Suppose we want a count of 300 words or less:

ValidationExpression="^(\b\S+\b\s*){0,300}$"

ValidationExpression="(((^\s*)*\S+\s+)|(\S+)){1,300}"

Thanks, Stack Overflow.

Thanks, RegEx Lib.

Advertisements