正则表达式的Corporate Identification Number (CIN):

huangapple go评论72阅读模式
英文:

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

CIN DECODED IMAGE

答案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})$';

huangapple
  • 本文由 发表于 2023年2月16日 15:16:41
  • 转载请务必保留本文链接:https://go.coder-hub.com/75468924.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定