前6个字母应该是字符 [英] First 6 letter should be character
本文介绍了前6个字母应该是字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
文本框允许带有特殊字符连字符和空格的字母数字字符。
前6个字母应为字母...请在jquery中给我一个答案
Hi,
Textbox allowing Alpha numeric characters with special characters hyphen and space.
First 6 letters should be alphabets...please get me an answer in jquery
推荐答案
试试正则表达式:
Try a regular expression:
public static Regex regex = new Regex(
"^([a-zA-Z]{1,6}
) |([a-zA-Z] {6} [\\w-] *
)|([a-zA-Z]{6}[\\w- ]*
),
RegexOptions.IgnoreCase
| RegexOptions.Multiline
| RegexOptions.CultureInvariant
| RegexOptions.IgnorePatternWhitespace
| RegexOptions.Compiled
);
匹配m = regex.Match(InputText);
if (m.Success)
{
...
)", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.CultureInvariant | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled ); Match m = regex.Match(InputText); if (m.Success) { ...
这篇关于前6个字母应该是字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文