Utilities

Convenient common utilities to use.

Regex Pattern

/** regex to check if the Nrc is correct pattern */
const pattern = {
  en: /\d{1,2}\/[A-Z]{6,6}\((N|E|P|T|R|S)\)\d{5,6}/,
  mm: /[แ€-แ‰]{1,2}\/[แ€€-แ€ก]{3,3}\((แ€”แ€ญแ€ฏแ€„แ€บ|แ€งแ€Šแ€ทแ€บ|แ€•แ€ผแ€ฏ|แ€žแ€ฌแ€žแ€”แ€ฌ|แ€šแ€ฌแ€šแ€ฎ|แ€…)\)([แ€-แ‰]{5,6}|[0-9]{5,6})/,
};

Functions

Convert English NRC string to Myanmar NRC string

function convertToMmNrc(engNrc: string): string;

Convert Myanmar NRC string to English NRC string

function convertToEnNrc(mmNrc: string): string;

De-structure NRC data from the NRC string

function splitNrc(nrc: string): {
  nrcNumber: string;
  nrcType: string;
  stateNo: string;
  townshipCode: string
};

Last updated