Skip to content

Commit

Permalink
WIP: regExp
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavochavarria committed Sep 22, 2019
1 parent 1e993c3 commit 5b618a9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export const dnic = (dni) => {
//check entries
export const dnic = dni => {
console.log('dni: ', dni);

//([0-6][0-9]{2})-([0-2][0-9]|3[0-1])(0[1-9]|1[0-2])([0-9]{2})-([0-9]{4}[A-X])
const regExp = RegExp('([0-6][0-9]{2})-([0-2][0-9]|3[0-1])(0[1-9]|1[0-2])([0-9]{2})-([0-9]{4}[A-X])');

return regExp.test(dni);
};

0 comments on commit 5b618a9

Please sign in to comment.