By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,965 Members | 1,757 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,965 IT Pros & Developers. It's quick & easy.

Regular Expression

P: n/a
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,

--
Peter Afonin
May 29 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
(?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" <pa*****@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP04.phx.gbl...
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,

--
Peter Afonin

May 29 '06 #2

P: n/a
Thank you very much, Kevin.

Peter

"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:e$**************@TK2MSFTNGP02.phx.gbl...
(?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" <pa*****@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP04.phx.gbl...
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,

--
Peter Afonin


May 29 '06 #3

P: n/a
Kevin, is this everything that should be there? For some reason

(?s)^.{8,64}

doesn't allow me any characters...

Thanks,

Peter

Kevin Spencer wrote:
(?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" <pa*****@hotmail.com> wrote in message
news:O8**************@TK2MSFTNGP04.phx.gbl...
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,

--
Peter Afonin


May 31 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.