+(defun query-replace-regexp-eval (regexp to-expr &optional delimited start end)
+ "Replace some things after point matching REGEXP with the result of TO-EXPR.
+As each match is found, the user must type a character saying
+what to do with it. For directions, type \\[help-command] at that time.
+
+TO-EXPR is a Lisp expression evaluated to compute each replacement. It may
+reference `replace-count' to get the number of replacements already made.
+If the result of TO-EXPR is not a string, it is converted to one using
+`prin1-to-string' with the NOESCAPE argument (which see).
+
+For convenience, when entering TO-EXPR interactively, you can use `\\&' or
+`\\0'to stand for whatever matched the whole of REGEXP, and `\\=\\N' (where
+N is a digit) stands for whatever what matched the Nth `\\(...\\)' in REGEXP.
+Use `\\#&' or `\\#N' if you want a number instead of a string.
+
+In Transient Mark mode, if the mark is active, operate on the contents
+of the region. Otherwise, operate from point to the end of the buffer.
+
+If `query-replace-interactive' is non-nil, the last incremental search
+regexp is used as REGEXP--you don't have to specify it with the
+minibuffer.
+
+Preserves case in each replacement if `case-replace' and `case-fold-search'
+are non-nil and REGEXP has no uppercase letters.
+
+Third arg DELIMITED (prefix arg if interactive), if non-nil, means replace
+only matches surrounded by word boundaries.
+Fourth and fifth arg START and END specify the region to operate on."
+ (interactive
+ (let (from to start end)
+ (when (and transient-mark-mode mark-active)
+ (setq start (region-beginning)
+ end (region-end)))
+ (if query-replace-interactive
+ (setq from (car regexp-search-ring))
+ (setq from (read-from-minibuffer "Query replace regexp: "
+ nil nil nil
+ query-replace-from-history-variable
+ nil t)))
+ (setq to (list (read-from-minibuffer
+ (format "Query replace regexp %s with eval: " from)
+ nil nil t query-replace-to-history-variable from t)))
+ ;; We make TO a list because replace-match-string-symbols requires one,
+ ;; and the user might enter a single token.
+ (replace-match-string-symbols to)
+ (list from (car to) start end current-prefix-arg)))
+ (perform-replace regexp (cons 'replace-eval-replacement to-expr)
+ start end t t delimited))
+
+(defun map-query-replace-regexp (regexp to-strings &optional n start end)