英文:
Regular expression for Corporate Identification Number (CIN)
问题
我正在尝试验证CIN号码,根据印度政府法规,该模式如下:
- CIN是一个由21位字母和数字组成的代码。
- 它以字母U或L开头。
- 接下来的五个字符是为数字(0-9)保留的。
- 接下来两个位置由字母(A-Z-a-z)占据。
- 接下来的四个位置由数字(0-9)占据。
- 接下来的三个字符为字母(A-Za-z)保留。
- 接下来的六个字符是数字(0-9)。
- 它不应包含任何特殊字符或空格。
英文:
I'm trying to validate CIN number which has specific pattern according to Indian Government Regulations, Pattern is as follows :-
- CIN is a 21 digits alpha-numeric code.
- It starts with either alphabet letter U or L.
- Next five characters are reserved for digits (0-9).
- Next two places are occupied by alphabet letters(A-Z-a-z).
- Next four places are taken by digits(0-9).
- Next three characters are reserved for alphabet letters (A-Za-z).
- Next six characters are digits(0-9).
- It should not contain any special character or whitespaces
答案1
得分: 1
以下是翻译好的代码部分:
cinNumber = '^([LUu]{1})([0-9]{5})([A-Za-z]{2})([0-9]{4})([A-Za-z]{3})([0-9]{6})$';
英文:
Later, I've tried this pattern below for CIN number and It worked perfectly fine
cinNumber = '^([LUu]{1})([0-9]{5})([A-Za-z]{2})([0-9]{4})([A-Za-z]{3})([0-9]{6})$';
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论