I need a Regular Expression for "Atleast 6 characters with no spaces"
Please help
-
Any restrictions what characters it should be? Anything that is not a space? Letters, numbers?Fredrik Mörk– Fredrik Mörk2010-01-05 10:53:52 +00:00Commented Jan 5, 2010 at 10:53
-
Yes any character except space.Shantanu Gupta– Shantanu Gupta2010-01-05 10:56:40 +00:00Commented Jan 5, 2010 at 10:56
Add a comment
|
3 Answers
You can use \w{6,}
Also FYI:
you can use Regex Coach for Regular Expression experiments. It is easy to play with Regular Expressions by using tools like Regex Coach.
Comments
For literally any six non-space characters (other than newlines, depending on options):
[^ ]{6,}
For six non-whitespace characters:
\S{6,}
1 Comment
bernhof
In both cases it should be {6,} since vaibhav states "at least 6 characters"