我需要一个正则表达式的字母和空格 [英] I need a Regular expression for alphabet and space
本文介绍了我需要一个正则表达式的字母和空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你需要一个满足流动语言的正则表达式 -
1-
2-国王
它们之间最多允许两个单词和一个空格。请建议我好的正则表达式。
Hi Need one regular expression which satisfy the flowing words -
1- The
2- The King
Maximum two words and one space is allow between them. please suggest me good regex.
推荐答案
试试这个:
Try this:
^[a-zA-Z]+(\s[a-zA-Z]+)?
试试这个..
这是我用过的javascript及其工作方式。试试这个
Try this..
This is the javascript that i have used and its working.Try with this
function checkregex() {
if (!form1.TextBox1.value.match(/^[a-zA-Z ]+
这篇关于我需要一个正则表达式的字母和空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文