Browse Source

Add link to blog post about regex

ApisNecros 1 year ago
parent
commit
7bf84b5152
1 changed files with 3 additions and 0 deletions
  1. 3 0
      1/1_2.ts

+ 3 - 0
1/1_2.ts

@@ -18,6 +18,9 @@ function CalculateCalibrationSum(document: string[]): number {
  *
  * If only one digit is present, the one digit is concatenated to
  * itself.
+ * 
+ * Uses a lookahead regex group to handle nested words
+ * @see https://mtsknn.fi/blog/how-to-do-overlapping-matches-with-regular-expressions/#capturing-groups-inside-lookahead-lookbehind-assertions
  *
  * @param {string} line The line of text to extract the calibration value out of
  * @returns {number} The two-digit calibration value hidden in that string