code: def build_match_and_apply_functions(pattern, replace):
      """Assemble regex patterns."""
  
      def matches_rule(word):
          return re.search(pattern, word)
  
      def apply_rule(word):
          return re.sub(pattern, replace, word)
  
      return matches_rule, apply_rule
  
label_desc: Use image node_id 1 for calling a global function with example usage: build_match_and_apply_functions(pattern, replace) and returns: matches_rule,  apply_rule, re, re