tags:

views:

75

answers:

2

I need to use a RegEx to set an upper boundry for the length of an input string.

Its been ages since I used RegEx so any help would be good. :)

+2  A: 

If you want max 10 characters:

^.{,10}$
Philippe Leybaert
Thanks that what I was looking for :)
Jambobond
+1  A: 
^.{,5}$

The ^ and $ make it check the entire string. {,5} is maximum of five.

Ikke
Thanks that what i was looking for :)
Jambobond