Closed bf4 closed 11 years ago
See https://github.com/bf4/gemproject/pull/10 and https://twitter.com/hazula/status/396334305313431553
list = ["jordansissel\n", "iconara\n", "michaelklishin\n", "atech\n", "adamcooke\n", "niftyware\n"].map(&:strip) wrong_regexes = list.map{|username| /#{username}/io } # => [/jordansissel/i, /jordansissel/i, /jordansissel/i, /jordansissel/i, /jordansissel/i, /jordansissel/i] correct_regexes = list.map{|username| /#{username}/i } # => [/jordansissel/i, /iconara/i, /michaelklishin/i, /atech/i, /adamcooke/i, /niftyware/i]
The o flag caused the regex to compile only once, which ignored the other blacklisted usernames
o
See https://github.com/bf4/gemproject/pull/10 and https://twitter.com/hazula/status/396334305313431553
The
o
flag caused the regex to compile only once, which ignored the other blacklisted usernames