我有一个表达式,我需要验证。我想用正则表达式来做。请帮忙。
AAsswwww-11233 (First 2 char are static - then any alphabets only - then hyphen - then only digits.
答案 0 :(得分:2)
尝试
var regex = new Regex(@"^AA[a-zA-Z]+-[0-9]+$");
答案 1 :(得分:1)
@"^AA[A-Za-z]+[-]\d+$"
Learn How to Use and Get The Most out of Regular Expressions