You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: TargetValidator.rb
    path of file: ./repos/expo/packages/expo-dev-menu
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
class Array
  # Removes and returns the elements for which the block returns a
    
  def expo_extract!
    return to_enum(:extract!) { size } unless block_given?

    extracted_elements = []

    reject! do |element|
      extracted_elements << element if yield(element)
    end

    extracted_elements
  end