Skip to content

Commit

Permalink
Update mailbox regex
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian-Hirt committed Dec 20, 2023
1 parent c731578 commit cae6392
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/schemacop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cae6392

Please sign in to comment.