Browse Source

regex update

karl.hudgell 3 years ago
parent
commit
947fc4a1a7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Day 4/part1_2.js

+ 1 - 1
Day 4/part1_2.js

@@ -1149,7 +1149,7 @@ async function part2(validArray) {
                         //Eye Colour
                         if (eyeColour.includes(ecl[1])) {
                             //passport ID
-                            if (pid[1].match(/\d{9}/g) && pid[1].length == 9) {
+                            if (pid[1].match(/\b\d{9}\b/g)) {
                                 //Height
                                 // Height in CM
                                 if (hgt[1].includes('cm')) {