diff --git a/lib/schemacop.rb b/lib/schemacop.rb index 0e4c56c..2ef002f 100644 --- a/lib/schemacop.rb +++ b/lib/schemacop.rb @@ -55,16 +55,11 @@ def self.register_string_formatter(name, pattern:, handler:) handler: ->(value) { value } ) - # rubocop: disable Layout/LineLength - # rubocop: disable Style/RegexpLiteral register_string_formatter( :mailbox, - pattern: /^("\p{Print}+"\s)?<[a-zA-Z0-9.!\#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*>$/, + pattern: /^("\p{Print}+"\s)?<#{URI::MailTo::EMAIL_REGEXP.source[2...-2]}>$/, handler: ->(value) { value } ) - # rubocop: enable Style/RegexpLiteral - # rubocop: enable Layout/LineLength - register_string_formatter( :boolean, pattern: /^(true|false|0|1)$/i,