<commit_before>module Rpush
  module Client
    module ActiveModel
      module Apns
        class DeviceTokenFormatValidator < ::ActiveModel::Validator
          def validate(record)
            return if record.device_token =~ /^[a-z0-9]\w+$/i
            record.errors.add :device_token, "is invalid"
          end
        end
      end
    end
  end
end<commit_msg>Use \A, \z instead of ^, $ to validate device token<commit_after>module Rpush
  module Client
    module ActiveModel
      module Apns
        class DeviceTokenFormatValidator < ::ActiveModel::Validator
          def validate(record)
            return if record.device_token =~ /\A[a-z0-9]\w+\z/i
            record.errors.add :device_token, "is invalid"
          end
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.08226221079691516, 'fraction_numerical': 0.005141388174807198, 'mean_word_length': 2.0549019607843135, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7392136', 'n_tokens_mistral': 224, 'n_tokens_neox': 220, 'n_words': 61}