gricha2380 / regex

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

Visual matching isn't properly constrined #31

Closed gricha2380 closed 6 years ago

gricha2380 commented 6 years ago

Repro: Story Mode - hello world start ^ Single char: hello

Player pattern shows: /^hello/g and enemymatch is ["hello"] but visual match includes o and l from world.

gricha2380 commented 6 years ago

The issue is ~line 107 in battle.js

if(currentWord[i]===enemyArray[x] && enemyArray[x]!==" "){

It's checking the character at the current position. The proper way would be to match the index & character. It may be tricky because I'm removing spaces, but I'll experiment and see.