Browse Source

Remove all invalid characters upon filtering

Fixes #4.
master
F.W. Dekker 2 years ago
parent
commit
2cb3f67b74
Signed by: FWDekker GPG Key ID: B1B567AF58D6EE0F
  1. 2
      index.html

2
index.html

@ -87,7 +87,7 @@
filterBaseString(baseString) {
// Regex from https://stackoverflow.com/a/3561711/
const regexSafeAlphabet = this.alphabet.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
return baseString.replace(new RegExp(`[^${regexSafeAlphabet}]`), "");
return baseString.replace(new RegExp(`[^${regexSafeAlphabet}]`, "g"), "");
}
}

Loading…
Cancel
Save