On Feb 12, 3:49 am, "J. mp" <joaomiguel.pere... / gmail.com> wrote: > Gavin Kistner wrote: > > /\A[a-z][a-z.-]{3,28}[a-z]\Z/i [snip] > > Note that, per your exact instructions, this allows: > > u_s_e_r_n_a_m_e > > u____________________________e > > z._-_.z > > Oh damm!! the first should be allowed but second and the third should > not be allowed OK, but *why* aren't they allowed. You haven't described exactly what your requirements are. Is it because you can't have to non-letters in a row? Is it because the string must contain at least three letters? BTW, where are these requirements coming from? Are these business requirements that must be enforced? Are you just making up what you think people should probably have to use as a name? Or are you just trying to learn regexp?