Regular Expression

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Afonin

    Regular Expression

    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


  • Kevin Spencer

    #2
    Re: Regular Expression

    (?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@hotmai l.com> wrote in message
    news:O8XgXVtgGH A.2456@TK2MSFTN GP04.phx.gbl...[color=blue]
    > 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
    >
    >[/color]


    Comment

    • Peter Afonin

      #3
      Re: Regular Expression

      Thank you very much, Kevin.

      Peter

      "Kevin Spencer" <kevin@DIESPAMM ERSDIEtakempis. com> wrote in message
      news:e$jYOPygGH A.3984@TK2MSFTN GP02.phx.gbl...[color=blue]
      > (?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@hotmai l.com> wrote in message
      > news:O8XgXVtgGH A.2456@TK2MSFTN GP04.phx.gbl...[color=green]
      >> 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
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Peter Afonin

        #4
        Re: Regular Expression

        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:[color=blue]
        > (?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@hotmai l.com> wrote in message
        > news:O8XgXVtgGH A.2456@TK2MSFTN GP04.phx.gbl...[color=green]
        > > 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
        > >
        > >[/color][/color]

        Comment

        Working...