gricha2380 / regex

https://gricha2380.github.io/regex/demo
0 stars 0 forks source link

Omit blank spaces from matchEnemies #34

Closed gricha2380 closed 6 years ago

gricha2380 commented 6 years ago

Currently matchEnemies() adds a check to blank spaces. In the process it also offsets the addClass leaving out the last digit. This can be repro'd by playing Not a Digit card with "hello world" string.

gricha2380 commented 6 years ago

solved. I added a conditional check for match[0] !== " " so the range doesn't flow to matchSet, and in matchSet I placed another check: resultArray[i] !== ' '. But ultimately, what fixed it? I had to raise the limit on my infinite loop counter. counter >=10 was too low. Doh. I'm still leaving the new checks in place though.