Regular Expression for multiline validation

M

Mark

To validate the length of a multiline textbox, I'm told that I have to use a
regular expression validator. The regular expression below limits it to 25
characters in length, but if the user enters a hard return, it bombs
regardless of length. How do you allow hard returns in the following
regular expression? Thanks in advance!

^.{0,25}$

Mark
 
S

S. Justin Gengo

Mark,

Sorry, I took that expression from another forum's post. I had never
actually tested it myself. My bad. I just played around a bit. Try this
instead: ^[\s\S]{0,10}$

--
S. Justin Gengo, MCP
Web Developer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
E

Eric

Use a regular expression validator with the expression "(.|\r|\n){0,255}"
replacing the 0 and 255 with the minimum and maximum lengths that you need.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top