How can I make it to validate this string:
word:word,word:word,
What I wrote this and works only for:
word:word,enithinggg
which is wrong.
/^(^([0-9a-zA-Z!\? ])+\:([0-9a-zA-Z!\?. ])+\,)+$/i
How can I make it to validate this string:
word:word,word:word,
What I wrote this and works only for:
word:word,enithinggg
which is wrong.
/^(^([0-9a-zA-Z!\? ])+\:([0-9a-zA-Z!\?. ])+\,)+$/i
/^(([0-9a-zA-Z!\?])+\:([0-9a-zA-Z!\?])+\,?)+$/
应该这样做。您^
在第一组内,迫使它匹配换行符。我对javascript正则表达式不太熟悉,所以我不确定i
最后在做什么。
您可以在http://rubular.com上运行快速测试