HighTechTalks DotNet Forums  

Regular Expression

ASP.net ASP.net discussions (microsoft.public.dotnet.framework.aspnet)


Discuss Regular Expression in the ASP.net forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Peter Afonin
 
Posts: n/a

Default Regular Expression - 05-29-2006 , 12:07 AM






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



Reply With Quote
  #2  
Old   
Kevin Spencer
 
Posts: n/a

Default Re: Regular Expression - 05-29-2006 , 09:28 AM






(?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" <pafonin (AT) hotmail (DOT) com> wrote

Quote:
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





Reply With Quote
  #3  
Old   
Peter Afonin
 
Posts: n/a

Default Re: Regular Expression - 05-29-2006 , 05:09 PM



Thank you very much, Kevin.

Peter

"Kevin Spencer" <kevin (AT) DIESPAMMERSDIEtakempis (DOT) com> wrote

Quote:
(?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" <pafonin (AT) hotmail (DOT) com> wrote in message
news:O8XgXVtgGHA.2456 (AT) TK2MSFTNGP04 (DOT) 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







Reply With Quote
  #4  
Old   
Peter Afonin
 
Posts: n/a

Default Re: Regular Expression - 05-31-2006 , 07:15 PM



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:
Quote:
(?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" <pafonin (AT) hotmail (DOT) com> wrote in message
news:O8XgXVtgGHA.2456 (AT) TK2MSFTNGP04 (DOT) 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




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.