EFForg / OpenWireless

The official home of the EFF OpenWireless Project
Other
732 stars 80 forks source link

Update diceware.js #247

Closed sarciszewski closed 9 years ago

sarciszewski commented 10 years ago

Prevent whitespace bugs when parsing the PGP-signed wordlist. (I used this library separately in another project and ran head-first into this issue.)

jsha commented 10 years ago

I think \s*? isn't what you want. Normally ? marks an item as optional, but that would be redundant with the * operator since * can match zero characters. Additionally, ? has a special meaning when it comes after * or +. It means to do a non-greedy match, which is not necessary here because there's always going to be a digit afterwards.

I'd suggest replacing \s*? with \s*.

sarciszewski commented 10 years ago

Err, yes. Wasn't paying super close attention there :)