如何验证卡潘? [英] How to verify card PAN?
本文介绍了如何验证卡潘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何查看编辑文本的验证,如ABCDE1234F泛卡。我很困惑如何检查验证了这一点。请帮我,大家好我AP preciated
How to check the validation of edit text for pan card like "ABCDE1234F". I am confused how to check the the validation for this. please help me guys i appreciated
推荐答案
您可以使用普通的防爆pression与模式匹配
You can use Regular Expression with pattern matching
String s = "ABCDE1234F"; // get your editext value here
Pattern pattern = Pattern.compile("[A-Z]{5}[0-9]{4}[A-Z]{1}");
Matcher matcher = pattern.matcher(s);
// Check if pattern matches
if (matcher.matches()) {
Log.i("Matching","Yes");
}
[A-Z]{5} - match five literals which can be A to Z
[0-9]{4} - followed by 4 numbers 0 to 9
[A-Z]{1} - followed by one literal which can A to Z
您可以测试正则表达式@
You can test regex @
http://java-regex-tester.appspot.com/
http://docs.oracle.com/javase/tutorial/essential/regex /
这篇关于如何验证卡潘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文