瀏覽代碼

regex update

karl.hudgell 4 年之前
父節點
當前提交
947fc4a1a7
共有 1 個文件被更改,包括 1 次插入1 次删除
  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')) {