urnNumberValidate method

bool urnNumberValidate({
  1. required String content,
})

This Method will validate your content from URN Number Format. content Content is a Required parameter. Pass your inputed or that value which you want to compare with URN Number format.

Implementation

bool urnNumberValidate({required String content}) {
    if (content.length != 19) {
      return false;
    } else {
      return RegExp(r"(UDYAM)[-][A-Z]{2}[-][0-9]{2}[-][0-9]{7}")
          .hasMatch(content);
    }
  }