Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...About regular expression validatorAbout regular expression validator
Previous
 
Next
New Post
11/24/2007 10:28 AM
 

Hello,

I know this is not a DNN related question but I think maybe someone on this Forums may know the asnwer so...

My question is: how do I set up a regular expression validator so that the value entered must be at least 5 words long?

Regards,

Duc Le

 
New Post
11/25/2007 9:50 AM
 

Use the following RegEx pattern for your RegularExpressionValidator:

(\b[a-z0-9]+\b.*){5,}

This pattern will match if the input has 5 words or more, it will fail if it is under 5 words. Of course, you'll have to do something a little bit different if you also want to verify that each word has a minimum length as well.

Example:

"a sample of a match" as an input string will pass this pattern.

"this does not pass" as an input string will fail this pattern.

Notes:

Single letter words will be valid with this RegEx pattern.

If you want to change the min count, just change the "5"  in the last bracket set to your desired min. word count.

Modification to Pattern:

A simple modification of the above RegEx pattern for your RegularExpressionValidator:

(\b[a-z0-9]{3,}\b.*){5,}

This example will give you a minum word count of five, and each word must be at least 3 characters in length.

This one will not only give you your desired min. word count, but it will also validate that each word has a minumum length as well.

Notes:

Change the "{3,}" to your required min. word length

Change the "{5,}" to your required min. word count.

 

Hope this helps...

 
New Post
11/25/2007 10:27 AM
 

Thanks a million, Ed!

I now understand how this works. But what I want to validate is the password field. The validation you provided only allows WORDS to be typed in. Are there any rules that allow EVERY characters on the keyboard?

Thanks again,

Duc Le

 
New Post
11/26/2007 11:27 AM
 

-Mitchel Sellers
Microsoft MVP, ASPInsider, DNN MVP
CEO/Director of Development - IowaComputerGurus Inc.
LinkedIn Profile

Visit mitchelsellers.com for my mostly DNN Blog and support forum.

Visit IowaComputerGurus.com for free DNN Modules, DNN Performance Tips, DNN Consulting Quotes, and DNN Technical Support Services
 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...About regular expression validatorAbout regular expression validator


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out