Skip to content

Commit

Permalink
Remove additional spaces from RegExp pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
jmortlock committed Dec 19, 2016
1 parent 1021e05 commit c819bc4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/sensitive_data_filter/types/credit_card.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ module Types
module CreditCard
SEPARATORS = /[ -]/
SEPRS = SEPARATORS.source + '*'
CARD_16_DIGITS = /\d{4} #{SEPRS} \d{4} #{SEPRS} \d{4} #{SEPRS} \d{4}/
CARD_13_DIGITS = /\d{3} #{SEPRS} \d{3} #{SEPRS} \d{3} #{SEPRS} \d #{SEPRS} \d{3}/
CARD_14_DIGITS = /\d{4} #{SEPRS} \d{6} #{SEPRS} \d{4}/
CARD_15_DIGITS = /\d{4} #{SEPRS} \d{6} #{SEPRS} \d{5}/
CARD_16_DIGITS = /\d{4}#{SEPRS}\d{4}#{SEPRS}\d{4}#{SEPRS}\d{4}/
CARD_13_DIGITS = /\d{3}#{SEPRS}\d{3}#{SEPRS}\d{3}#{SEPRS}\d#{SEPRS}\d{3}/
CARD_14_DIGITS = /\d{4}#{SEPRS}\d{6}#{SEPRS}\d{4}/
CARD_15_DIGITS = /\d{4}#{SEPRS}\d{6}#{SEPRS}\d{5}/
CARD = /
(?<!\d)(?:
#{CARD_16_DIGITS.source}
Expand Down

0 comments on commit c819bc4

Please sign in to comment.