Skip to content

Commit

Permalink
corrige regex primera version DNI
Browse files Browse the repository at this point in the history
  • Loading branch information
kroce committed May 27, 2021
1 parent 0f99380 commit ad2b3c7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/providers/scan-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export interface DocumentoEscaneado {
export const DocumentoEscaneados: DocumentoEscaneado[] = [
// DNI Argentino primera versión
{
regEx: /@([MF]*[A-Z0-9]+)\s*@[A-Z]+@[0-9]+@([a-zA-ZñÑáéíóúÁÉÍÓÚÜü'\-\s]+)@([a-zA-ZñÑáéíóúÁÉÍÓÚÜü'\-\s]+)@[A-Z]+@([0-9]{2}\/[0-9]{2}\/[0-9]{4})@([MF])@/i,
regEx: /@([MF]*[A-Z0-9]+)\s*@[A-Z]+@[0-9]+@([a-zA-ZñÑáéíóúÁÉÍÓÚÜü'\-\s]+)@([a-zA-ZñÑáéíóúÁÉÍÓÚÜü'\-\s]+)@[A-Z]+@([0-9]{2}\/[0-9]{2}\/[0-9]{4})@([MF])@([0-9]{2}\/[0-9]{2}\/[0-9]{4})@([0-9]+)@/i,
grupoNumeroDocumento: 1,
grupoApellido: 2,
grupoNombre: 3,
grupoSexo: 5,
grupoFechaNacimiento: 4,
grupoTramite: null
grupoTramite: 7
},
// DNI Argentino segunda y tercera versión
// Formato: 00327345190@GARCIA@JUAN FRANCISCO@M@23680640@A@25/08/1979@06/01/2015@209
Expand Down Expand Up @@ -51,7 +51,6 @@ export const DocumentoEscaneados: DocumentoEscaneado[] = [
export class ScanParser {

public scan(texto: string) {
console.log(texto);
const scanFormat = this.findFormat(texto);
if (scanFormat) {
return this.parseDocumentoEscaneado(scanFormat, texto);
Expand Down

0 comments on commit ad2b3c7

Please sign in to comment.