mrandrewmills / substitution-cipher

JavaScript object for playing with simple monoalphabetic substitution ciphers.
0 stars 0 forks source link

JSLint complains about negation character in regex of distillUpperUniqueAlphas #6

Closed mrandrewmills closed 9 years ago

mrandrewmills commented 9 years ago

There's a regex formula in the distillUpperUniqueAlphas that JSLint is complaining about as being potentially insecure.

phrase = phrase.replace(/[^a-zA-Z]/g, "");

If we can find another way to filter out non-alpha characters that JSLint won't complain about, I'd prefer it. If we can't, then we can't.

mrandrewmills commented 9 years ago

Resolved in 1e0d116e77656a8c9f117a5b874ace60f3e282a8.

phrase = phrase.match(/[a-zA-Z]/g); phrase = phrase.toString(); phrase = phrase.replace(/[,]/g, "");