Regular Expression

P

Peter Afonin

Hello,

I'm looking for a simple regular expression for the Regular Expression
validator that would allow any text, spaces and the line breaks and had a
minimum and maximum text length. Something like this one:

^([a-zA-z0-9\s]{8,64})$

This one doesn't allow line breaks and allows only alphanumeric characters.

For some reason I couldn't find it here: http://regexlib.com

I would appreciate your suggestions very much.

Thank you,
 
K

Kevin Spencer

(?s)^.{8,64}

The "(?s)" indicates that the dot matches newline characters. Therefore, any
character qualifies as a match. The only thing limited is the number of
characters.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

This is, by definition, not that.
 
P

Peter Afonin

Thank you very much, Kevin.

Peter

Kevin Spencer said:
(?s)^.{8,64}

The "(?s)" indicates that the dot matches newline characters. Therefore,
any character qualifies as a match. The only thing limited is the number
of characters.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

This is, by definition, not that.

Peter Afonin said:
Hello,

I'm looking for a simple regular expression for the Regular Expression
validator that would allow any text, spaces and the line breaks and had a
minimum and maximum text length. Something like this one:

^([a-zA-z0-9\s]{8,64})$

This one doesn't allow line breaks and allows only alphanumeric
characters.

For some reason I couldn't find it here: http://regexlib.com

I would appreciate your suggestions very much.

Thank you,
 
P

Peter Afonin

Kevin, is this everything that should be there? For some reason

(?s)^.{8,64}

doesn't allow me any characters...

Thanks,

Peter

Kevin said:
(?s)^.{8,64}

The "(?s)" indicates that the dot matches newline characters. Therefore, any
character qualifies as a match. The only thing limited is the number of
characters.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

This is, by definition, not that.

Peter Afonin said:
Hello,

I'm looking for a simple regular expression for the Regular Expression
validator that would allow any text, spaces and the line breaks and had a
minimum and maximum text length. Something like this one:

^([a-zA-z0-9\s]{8,64})$

This one doesn't allow line breaks and allows only alphanumeric
characters.

For some reason I couldn't find it here: http://regexlib.com

I would appreciate your suggestions very much.

Thank you,
 

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,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top