Regular expression to match maximium of five words.
Posted
by KhanS
on Stack Overflow
See other posts from Stack Overflow
or by KhanS
Published on 2010-04-09T06:42:15Z
Indexed on
2010/04/09
7:13 UTC
Read the original article
Hit count: 446
I have a regular expression
^[a-zA-Z+#-.0-9]{1,5}$
which validates that the word contains alpha-numeric characters and few special characters and length should not be more than 5
characters.
How do I make this regular expression to accept a maximum of five words matching the above regular expression.
© Stack Overflow or respective owner