http://sufikatha.com
Nishanth's Blog | Regular expression Validator against multiline textbox carriage return issue

Regular expression Validator against multiline textbox carriage return issue

by Nishanth 5. March 2009 02:32

I was trying to validate a multipline asp text box that can have a maximum of 150 word characters but any number of white space, carriage returns or tabs and special characters. I tried several regex but all were failing when there was a carriage return(Newline / Enterkey ) on the multiline textbox.

Then I found this expression which validated the newlines in the multiline textbox:

"[\s\S]{0,150}" .

 

The basics!!  Try this out , this works!!

Currently rated 5.0 by 4 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Comments

Add comment


 

  Country flag

biuquote
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About Me

Nishanth Nair  

 A die hard fan of Rise of Nations... I write few softwares for McAfee Inc. for a living.

 

Portfolio:
http://Necab.org
http://SufiKatha.com
http://DeepaRecipes.com
http://ManipalFoundation.in
http://NetraArts.com
http‌://EnWebTech.com
Contact : Nair.Nishanth@Gmail.com 

All entries in this blog are my opinion and don't necessarily reflect the opinion of my employer.

Tag cloud

The World This Second

free counters