Nishanth's Blog | March 2009

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!!

Tags:

Powered by BlogEngine.NET 1.6.0.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://morningbellnews.com
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

free counters