标准普通防爆pression的员工ID [英] Standard Regular Expression for Employee ID
本文介绍了标准普通防爆pression的员工ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要的标准普通防爆pression为Employeed ID喜欢
EMP015
015EMP
EMP_015
E_015
EMP-015
EMP.VIS
EMP / 056
基本上,它应该允许
或 _
或 -
或 /
在中间的字母数字字符
条件:
- 在第一个字符不应该是
_
或-
或/
- 雇员ID的长度应为50个字符。
解决方案
尝试使用该为你的正则表达式:
@^ [A-Z \ D] {1} [A-Z \ D ._ / \ - ] {49} $
样品code:
正则表达式oRegex =新的正则表达式(@^ [AZ \ D] {1} [AZ \ D ._ / \ - ] {49} $);
oRegex.IsMatch(EMP_01512312312312 / 31-2312.31231231231322222222222); // 真正
I need Standard Regular Expression for Employeed ID like
EMP015
015EMP
EMP_015
E_015
EMP-015
EMP.VIS
EMP/056
Basically it should allow .
or _
or -
or /
in-between alpha-numeric characters
Conditions:
- First character should not be
.
or_
or-
or/
- Length of Employee ID should be 50 characters.
解决方案
Try using this for your regex pattern:
@"^[A-Z\d]{1}[A-Z\d._/\-]{49}$"
Sample code:
Regex oRegex = new Regex(@"^[A-Z\d]{1}[A-Z\d._/\-]{49}$");
oRegex.IsMatch("EMP_01512312312312/31-2312.31231231231322222222222"); // true
这篇关于标准普通防爆pression的员工ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文