^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,15}$
My regex above works fine except it accepts space as input. How can i exclude spaces on my regex?
Any Perl related regex implementation will be fine. Thanks
^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,15}$
My regex above works fine except it accepts space as input. How can i exclude spaces on my regex?
Any Perl related regex implementation will be fine. Thanks
Change
.{8,15}
to
[^ ]{8,15} # No spaces.
or
\S{8,15} # No whitespace.
or
[A-Za-z0-9#?!@$%^&*\-]{8,15} # Only allow specific characters.