Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / September 2007

Tip: Looking for answers? Try searching our database.

Regex

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bobby - 20 Sep 2007 17:50 GMT
Hi,

I am looking for a regular expressiion to validate multiline text box.

It should allow carraige returns and accepts white space also

Thanks
Mark Rae [MVP] - 20 Sep 2007 18:14 GMT
> I am looking for a regular expressiion to validate multiline text box.
>
> It should allow carraige returns and accepts white space also

But what do you want it to validate?

What's acceptable...?

What's not...?

Signature

Mark Rae
ASP.NET MVP
http://www.markrae.net

bobby - 20 Sep 2007 19:42 GMT
It should accept nmaximum 500 characters in multiline text box

> > I am looking for a regular expressiion to validate multiline text box.
> >
[quoted text clipped - 5 lines]
>
> What's not...?
Jesse Houwing - 20 Sep 2007 21:20 GMT
Hello Bobby,

> It should accept nmaximum 500 characters in multiline text box "Mark
> Rae [MVP]" wrote:
[quoted text clipped - 14 lines]
>> ASP.NET MVP
>> http://www.markrae.net

$(?s:.){500}$

should do it.

though if you want to count a carriage return + linefeed as one or as zero
characters you'd need to adjust it a bit.

Remember that this won't ensure that the maximum number of bytes never exceeds
500, Unicode will mprobably stump you there.

--
Jesse Houwing
jesse.houwing at sogeti.n

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.