Simple regular expression for length

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

    Simple regular expression for length

    Hi,

    What regular expression should I use to allow any character (including space
    etc) but only with a length of 6 to 8 characters?

    Regards Magnus



  • Jesse Houwing

    #2
    Re: Simple regular expression for length

    Hello Magnus,
    Hi,
    >
    What regular expression should I use to allow any character (including
    space etc) but only with a length of 6 to 8 characters?
    >
    Regards Magnus
    >
    This question is so easily answered that I think you didn't try it yourself...

    ^.{6,8}$

    Should do.

    --
    Jesse Houwing
    jesse.houwing at sogeti.nl


    Comment

    • Magnus

      #3
      Re: Simple regular expression for length

      Well, I tried but...
      I read the syntax but missed exactly the row about ".".
      Thanks a lot
      /Magnus


      "Jesse Houwing" <jesse.houwing@ newsgroup.nospa mwrote in message
      news:21effc9042 3248ca416aa4b4e 2ea@news.micros oft.com...
      Hello Magnus,
      >
      >Hi,
      >>
      >What regular expression should I use to allow any character (including
      >space etc) but only with a length of 6 to 8 characters?
      >>
      >Regards Magnus
      >>
      >
      This question is so easily answered that I think you didn't try it
      yourself...
      >
      ^.{6,8}$
      >
      Should do.
      >
      --
      Jesse Houwing
      jesse.houwing at sogeti.nl
      >
      >

      Comment

      Working...