<commit_before>module Gitlab
  module Ci
    module Pipeline
      module Expression
        module Lexeme
          require_dependency 're2'

          class Pattern < Lexeme::Value
            PATTERN = %r{/(?<regexp>.+)/}.freeze

            def initialize(regexp)
              @value = regexp
            end

            def evaluate(variables = {})
              @regexp = Gitlab::UntrustedRegexp.new(@value)
            rescue RegexpError
              raise Expression::RuntimeError, 'Invalid regular expression!'
            end

            def self.build(string)
              new(string.match(PATTERN)[:regexp])
            end
          end
        end
      end
    end
  end
end<commit_msg>Remove useless assignment in pattern lexeme<commit_after>module Gitlab
  module Ci
    module Pipeline
      module Expression
        module Lexeme
          require_dependency 're2'

          class Pattern < Lexeme::Value
            PATTERN = %r{/(?<regexp>.+)/}.freeze

            def initialize(regexp)
              @value = regexp
            end

            def evaluate(variables = {})
              Gitlab::UntrustedRegexp.new(@value)
            rescue RegexpError
              raise Expression::RuntimeError, 'Invalid regular expression!'
            end

            def self.build(string)
              new(string.match(PATTERN)[:regexp])
            end
          end
        end
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.07681564245810056, 'fraction_numerical': 0.0013966480446927375, 'mean_word_length': 1.522887323943662, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, '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': '929922', 'n_tokens_mistral': 374, 'n_tokens_neox': 362, 'n_words': 91}